完善虎牙外部单展示、状态恢复与礼包配置

This commit is contained in:
yml2213
2026-11-11 12:40:06 +08:00
parent 3a48d9c624
commit b18e46d72d
18 changed files with 1216 additions and 120 deletions
+5
View File
@@ -456,6 +456,11 @@ def _config_out(config: HuyaConfig) -> HuyaConfigOut:
bind_gid=huya_config_value("bind_gid", config.bind_gid),
bind_act_id=huya_config_value("bind_act_id", config.bind_act_id),
pay_channel=huya_config_value("pay_channel", config.pay_channel),
points_page_code=huya_config_value("points_page_code", config.points_page_code),
points_source_id=huya_config_value("points_source_id", config.points_source_id),
points_scene=huya_config_value("points_scene", config.points_scene),
points_page_id=huya_config_value("points_page_id", config.points_page_id),
points_tab_ids=huya_config_value("points_tab_ids", config.points_tab_ids),
updated_at=config.updated_at,
)
+7 -3
View File
@@ -385,7 +385,7 @@ def create_external_order(
"""新建一行(可同时贴一份外部 CK)。订单号唯一,重复会 409。
``draft=true``:先建单后补资料 —— 订单号 + 店铺即可,状态进「待补资料」,
CK / 礼包名 / 主页截图稍后在详情里补(不跑探针)。
CK / 礼包名 / 主页截图稍后在详情里补;带了 CK 仍会自动跑一次只读探针。
``require_verified``(默认 true):人工新建表单的严格模式 —— 订单编号 / 店铺 / CK /
礼包名 / 主页截图必填,且 CK 必须探针通并读到绑定角色,否则 400
@@ -405,6 +405,7 @@ def create_external_order(
home_images=req.home_images,
remark=req.remark,
require_verified=req.require_verified,
auto_verify_ck=True,
draft=req.draft,
)
except collab.CollabError as exc:
@@ -443,14 +444,15 @@ def preview_external_order_ck(
新建弹窗据此决定能不能提交:``ok`` 且 ``has_role`` 才允许
(服务端在创建时还会再校验一次,见 ``POST /external-orders``)。
礼包用**工作台配置里的活动 SID**(``huya_config.sid``)拉:SID 就是活动 ID,
换活动就得换它,写死会出现「接口 200 但礼包列表是空的」(真机 2026-10-16)。
礼包用积分中心 ``queryAllocation`` 拉取;pageCode/sourceId/scene 与可选页签覆盖
来自虎牙配置,页签默认从响应自动发现并合并全部页签。
"""
try:
preview = collab.preview_ck(
req.ck_text,
with_gifts=req.with_gifts,
sid=collab.resolve_gifts_sid(db),
points_config=collab.resolve_points_center_config(db),
)
except collab.CollabError as exc:
raise _http_error(exc) from exc
@@ -502,6 +504,7 @@ def batch_update_external_order_status(
req.status,
reason=req.reason,
rollback=req.rollback,
force=req.force,
)
except collab.CollabError as exc:
raise _http_error(exc) from exc
@@ -767,6 +770,7 @@ def update_external_order_status(
req.status,
reason=req.reason,
rollback=req.rollback,
force=req.force,
)
except collab.CollabError as exc:
raise _http_error(exc) from exc