feat(weibo): 增加协作 CK 批量复制与商品图片代理
This commit is contained in:
@@ -1290,6 +1290,7 @@ def list_mall_goods(
|
||||
db,
|
||||
account,
|
||||
activity=WEIBO_DEFAULT_ACTIVITY,
|
||||
embed_images=True,
|
||||
)
|
||||
except (WeiboError, ValueError) as exc:
|
||||
raise _manual_http_error(exc) from exc
|
||||
|
||||
@@ -26,6 +26,8 @@ from ..schemas import (
|
||||
WeiboCollabAccountRequest,
|
||||
WeiboCollabArchiveRequest,
|
||||
WeiboCollabBalanceCheckRequest,
|
||||
WeiboCollabCkExportOut,
|
||||
WeiboCollabCkExportRequest,
|
||||
WeiboCollabExchangeCheckRequest,
|
||||
WeiboCollabGoodsCreate,
|
||||
WeiboCollabGoodsOut,
|
||||
@@ -370,6 +372,22 @@ def create_external_order(
|
||||
return _one(db, order)
|
||||
|
||||
|
||||
@router.post("/external-orders/ck/export", response_model=WeiboCollabCkExportOut)
|
||||
def export_external_orders_ck(
|
||||
req: WeiboCollabCkExportRequest,
|
||||
db: Session = Depends(get_db),
|
||||
current: User = Depends(require_permission("weibo:account:ck_export")),
|
||||
):
|
||||
"""按所选协作单导出关联微博账号的 CK 明文,并逐单写审计。"""
|
||||
|
||||
if "weibo:collab:view" not in get_user_permissions(current):
|
||||
raise HTTPException(status_code=403, detail="权限不足")
|
||||
try:
|
||||
return collab.export_cks(db, current, req.ids)
|
||||
except collab.CollabError as exc:
|
||||
raise _http_error(exc) from exc
|
||||
|
||||
|
||||
@router.post("/external-orders/verify/batch")
|
||||
def verify_external_orders_batch(
|
||||
ids: list[int],
|
||||
|
||||
Reference in New Issue
Block a user