From 6b10e866e96867399b82bea3ab2933632361a173 Mon Sep 17 00:00:00 2001 From: liujiahui Date: Sat, 4 Jul 2026 01:42:01 +0800 Subject: [PATCH] =?UTF-8?q?7-3=20=E5=B0=BE=E5=A3=B0=E5=B8=A7:=20/api/v1/tr?= =?UTF-8?q?ace/epilogue=20=E9=80=8F=E4=BC=A0=E5=A3=B3=20(#112)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 比价结果页"尾声帧"配套改动(透传壳一条)。 App 收到 done、渲染完比价结果页后, 把自己页面的截图(base64)经本壳透传给 pricebot `/api/trace/epilogue`, 存进 trace 目录并触发重传 —— trace 里补上"用户实际看到的 汇总页"(trace 步骤帧只有目标 App 画面, App 自渲染的汇总页天然在镜头外)。 壳同 `/trace/finalize`: 不鉴权、按 trace_id 一致性 hash 亲和。 配套分支(同名 7-3-ljh-testlab): pricebot-backend(端点+viewer 实拍块, PR #160) / shaguabijia-app-android(结果页拍屏上传)。 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: no_gen_mu Reviewed-on: https://gitea.shaguabijia.com/WonderableAI/shaguabijia-app-server/pulls/112 Co-authored-by: liujiahui Co-committed-by: liujiahui --- app/api/v1/compare.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/api/v1/compare.py b/app/api/v1/compare.py index 29362c1..b29ca8b 100644 --- a/app/api/v1/compare.py +++ b/app/api/v1/compare.py @@ -119,6 +119,14 @@ async def price_step(request: Request) -> dict[str, Any]: return await _passthrough(request, "/api/price/step") +@router.post("/trace/epilogue", summary="比价结果页尾声帧 (透传到 pricebot, 用户视角截图入 trace)") +async def trace_epilogue(request: Request) -> dict[str, Any]: + # App 收到 done、渲染完结果页后,把自己页面的截图(base64)传给 pricebot 存进 trace + # 目录并触发重传 —— trace 里补上"用户实际看到的汇总页"(步骤帧只有目标 App 画面)。 + # body ~几百 KB(截图 base64), 透传壳同 finalize(带 trace_id 亲和)。 + return await _passthrough(request, "/api/trace/epilogue") + + @router.post("/trace/finalize", summary="比价 trace 收尾上云 (透传到 pricebot, 终止/未识别拿 trace_url)") async def trace_finalize(request: Request) -> dict[str, Any]: # 用户终止 / Phase1 未识别没走到 done 帧, pricebot 没上云也没回传 trace_url。客户端收尾时