reallife_asset/wwwroot/api/sync_assets.dspy
yumoqing 86d2c4edc4 docs: add curl examples to all external APIs
- rl_verify.dspy: vendor param for creating verify session
- rl_upload.dspy: upload asset to vendor_group
- rl_status.dspy: query asset processing status
- rl_assets.dspy: list assets by vendor_group_id
- sync_assets.dspy: sync assets from vendor
- check_validate.dspy: check verify result with apikey/secretkey
2026-05-30 12:24:35 +08:00

25 lines
898 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ============================================================
# 从供应商同步素材到本地(按 group_id
# 参数: group_id(必填, 本地 rl_asset_group.id)
# 返回: bricks Message widget (前端专用)
# curl 示例:
# curl -X POST 'https://ai.atvoe.com/reallife_asset/api/sync_assets.dspy' \
# -H 'Authorization: Bearer YOUR_TOKEN' \
# -d 'group_id=LOCAL_GROUP_ID'
# ============================================================
org_id = (await get_userorgid()) or '0'
group_id = params_kw.get('group_id', '')
if not group_id:
return {"success": False, "message": "请选择素材组合"}
result = await rl_sync_assets_from_vendor(org_id, group_id)
return json.dumps({
"widgettype": "Message",
"options": {
"message": f"素材同步完成,共 {result.get('synced', 0)} 条记录",
"type": "success" if result.get('success') else "error"
}
})