docs(#70): document cmautobuy product importer

ila
2026-08-23 23:55:28 +08:00
parent 6863d83cfb
commit a5518705c3
+23
@@ -106,3 +106,26 @@ Android 骨架使用 Kotlin 1.9.22、AGP 8.2.0、Java 17 和 SDK 34。
- 浏览器打开 PDD、两层确认、商品详情识别和规格遍历。
- 网络断开、登录失效、验证码、风控和规则删除后的快照执行。
- 一台设备串行任务和 20 台设备连接稳定性。
## cmautobuy 商品导入
从 `server/` 运行 #70 独立命令。两个配置文件都必须是未被 Git 跟踪的本地文件;密码不接受命令行参数。
```powershell
# 默认只读预检,不写两个数据库
go run ./cmd/import-cmautobuy-products --source-config "D:\chengma\cmautobuy\admin\config.yaml" --target-config "D:\OPC\goauto\config.yaml"
# 仅在检查 dry-run 精确数量、备份目标商品表并再次人工确认后运行
go run ./cmd/import-cmautobuy-products --source-config "D:\chengma\cmautobuy\admin\config.yaml" --target-config "D:\OPC\goauto\config.yaml" --apply
```
也可分别用 `GOAUTO_CMAUTOBUY_CONFIG` 和 `GOAUTO_CONFIG` 指定路径。来源配置支持 `disabled` 或 `verify_ca`;相对 CA 路径按来源配置文件目录解析。导入报告不得包含 DSN、密码或原始业务响应。
MySQL 8.4 写入路径的隔离测试只允许连接名称以 `_test` 结尾的数据库:
```powershell
$env:GOAUTO_IMPORT_MYSQL_TEST_DSN="<仅由安全环境注入的 _test DSN>"
go test ./app/goauto/cmautobuyimport -run TestRunMySQL84DryRunAndApply -count=1
Remove-Item Env:GOAUTO_IMPORT_MYSQL_TEST_DSN
```