feat(douyu): 支持批量导出用户名
This commit is contained in:
@@ -44,6 +44,8 @@ from ..schemas import (
|
||||
DouyuCollabStatusRequest,
|
||||
DouyuCollabSummaryOut,
|
||||
DouyuCollabTimelineOut,
|
||||
DouyuCollabUsernameExportOut,
|
||||
DouyuCollabUsernameExportRequest,
|
||||
)
|
||||
from ..services import douyu_collab_service as collab
|
||||
from ..services.douyu_collab_events import collab_events
|
||||
@@ -369,6 +371,25 @@ def copy_external_order_ck(
|
||||
raise _http_error(exc) from exc
|
||||
|
||||
|
||||
@router.post(
|
||||
"/external-orders/usernames/export",
|
||||
response_model=DouyuCollabUsernameExportOut,
|
||||
)
|
||||
def export_external_order_usernames(
|
||||
req: DouyuCollabUsernameExportRequest,
|
||||
db: Session = Depends(get_db),
|
||||
_current: User = Depends(require_permission("douyu:collab:view")),
|
||||
):
|
||||
"""勾选多行导出关联的斗鱼用户名(前端写剪贴板)。
|
||||
|
||||
用户名不是凭据;能看列表的人本来就能看到,因此只需要查看权限。
|
||||
"""
|
||||
try:
|
||||
return collab.export_usernames(db, req.ids)
|
||||
except collab.CollabError as exc:
|
||||
raise _http_error(exc) from exc
|
||||
|
||||
|
||||
@router.post("/external-orders/{order_id}/activity/query")
|
||||
def query_external_order_activity(
|
||||
order_id: int,
|
||||
|
||||
Reference in New Issue
Block a user