feat(t225): freeze Go ERP protocol contract

This commit is contained in:
QiuSW
2026-07-29 09:21:32 +08:00
parent 11e480773a
commit c2f340d067
13 changed files with 836 additions and 31 deletions
+19
View File
@@ -21,6 +21,25 @@
接口来自 ERP 页面协议,不是已确认的开放 API。生产使用前必须确认厂商授权、请求
频率、服务账号和个人信息处理规则。
## Go 直连迁移契约(T-225)
T-225 在 `backend-api/internal/platform/shunyunbao` 用脱敏 fixture 固定以下内容,尚未
改变当前 Python Connector 运行时路径:
- 基础请求 header 固定 `Accept`、`Origin`、`Referer`、`User-Agent` 和
`X-Requested-With`;base URL 必须是无 userinfo、query、fragment 或路径的 origin。
- 单号条件为 `t_stock.allcode`、`op=6`、`type=0`、`optType=1`;日期范围为
`t_stock.created`、`op=0`、`type=3`、`optType=0`,单个 ERP 窗口最多 7 个自然日。
- `listTotal`、`list` 共享 `history=0`、`length`、`start`、`pageIndex`、`store=false`、
已验证 columns 和单一 `queries`;每页最多 500 条。
- `listByStock?hist=0` 每批最多 100 个去重后的正整数 stock id,详情 `id` 必须与列表
`stock.id` 一致。
- 所有结果必须经 Go allowlist 归一化;fixture 专门含收件信息、Cookie/JWT 标记值,
测试断言它们不会出现在输出或错误里。
Go 直连的验证码、登录和 Cookie jar 属于 T-226。不得用本地 OCR 或 Redis 取代人工
验证码流程;真实线上请求不属于自动化测试。
## 身份和规范字段
### 货运单