fc99be0392a1d153d5ce4e864bf822f55c17b888
Review fixes on the #338 backend: 1. New table return_match_log (models/return_match_log.go, registered in migrations.MigratedModels()): match_id/action/operator/detail/ created_at. sys_opera_log is a generic per-HTTP-call framework log, not queryable per match and not carrying operator/detail in a stable shape, so match/confirm/cancel/remark each write their own log row in the SAME transaction as the state change. Detail now returns the logs (newest first). 2. Race between matching and purchase creation: BatchMatch's outer screening pass (stage check outside any lock) is now followed by matchOneWithLock, which takes the same clause.Locking{Strength: "UPDATE"} lock on syb_product that purchase.Service.create takes, re-computes the stage inside that transaction via purchase.NewService(tx).ProcessStages, and returns errStageNoLongerEligible (surfaced as reasonCode stage_ineligible) if the product is no longer in a participating stage instead of inserting a stale match. TestMatchOneWithLock_SkipsWhenStageNoLongerParticipatesUnderLock covers the skip path. 3. matchOneWithLock now fills YeekeSpecText (raw variation_name) and PreviousProcessStage (the stage code at match time) on the inserted row. Remark takes an operator (for its log row) and rejects input over 500 runes with errRemarkTooLong instead of truncating (varchar(500) is a character-count limit in MySQL, so the check is utf8.RuneCountInString, not len()). 4. returnmatch.SYBSpecText now joins only non-empty color/size parts, so a single-dimension spec (e.g. color-only) no longer produces a stray leading/trailing comma ("黑色" instead of "黑色,"); matchKey additionally trims leading/trailing commas from both normalized sides via the new trimCommas() helper. New tests cover color-only and size-only matching through SelectMatches plus SYBSpecText/ trimCommas directly. 5. Detail (service.go) now returns MatchDetail: SYBDetailView (order code, shopee item id, shop, title, target color/size, quantity, image, current computed stage+label), YeekeDetailView (return order sn, item id, variation id, shop, item name, variation name, quantity, image, destroy deadline), both sides' normalized spec text, the match row itself, and the operation logs — everything the prototype's compare screen (screen 3) needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NTDbDcwbDw1TSAcE6wfh2F
GoAuto 移动采集管理平台
GoAuto 使用 go-admin、go-admin-ui 和 Android Portal/Agent 跑通 PDD 商品采集闭环:人工添加 PDD 链接、创建采集规则、创建任务、由 Android 执行并在任务详情查看结构化结果。
当前 MVP 只包含 PDD 商品、采集规则、采集任务、Android 执行和任务详情结果。顺云宝、Shopee、采购、批量任务、规则发布流程、全局停机和实时屏幕均不在当前范围。
阅读入口
旧版 ADB/Portal 验证代码、日志和诊断资料已归档到本机 demo/,该目录不进入 Git。
当前状态
- 需求和技术边界已确认。
- Harness Coding 文档和工单已建立。
- 服务端与 Android 端为可交互 HTML 原型。
server/已固定导入 go-adminv2.3.0。web/已固定导入 go-admin-uiv3.0.0。android/已建立 Kotlin/SDK 34 Agent 骨架。- 最小闭环 8 张业务表、迁移和唯一约束测试已经落地。
- 设备首次自注册、Token 认证、停用和吊销接口已经落地。
- Token 心跳、在线/离线、空闲/忙碌和离线任务失败已经落地。
验证
.\scripts\verify.ps1 -Component all
也可以把 all 改为 server、web 或 android 单独验证。
Languages
HTML
50.6%
Go
26.6%
Kotlin
10.4%
Vue
7.7%
JavaScript
1.9%
Other
2.7%