Files
data-engine/.codebuddy/memory/2026-06-01.md

30 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-06-01 工作记录
## 快手代发订单详情新增
- 新增 `open.dropshipping.order.merchant.detail``seed_data_kuaishou.sql`
- 第19个接口POST、prefetch 自 dropshipping_order_list、single_record
## 快手接口全面审查
发现 prefetch 相关7个接口存在3个严重Bug
1. Prefetch 阶段业务参数未包入 param JSONbody_wrapper_field 未生效)
2. Prefetch 阶段 `parseResp(nil config)` 无法解析 data.items/data.cpsOrderList 等路径
3. Prefetch 循环未处理游标分页(固定页码递增)
## Bug 修复dynamic_sync.go
1. `syncWithPrefetch` 改用 `buildReqBody(prefetchIface)` 构建请求body_wrapper_field 正确包装
2. 改用 `parseRespExt(resp.Body, prefetchIface.ResponseConfig)` 解析响应
3. 支持游标分页的 prefetch 循环cursor/pcursor
4. `buildPrefetchParams` 增加过滤 body_wrapper_field/exclude_from_wrapper/cursor_pagination/time_field_mode
5. 新增 `collectPrefetchEntities` 辅助函数
6. 修复并发阶段 `inQuery` 变量缺失的问题
## 同步调度并发锁修复
1. `SyncByConfig` 新增 `syncRunningMap` 内存锁sync.Map.LoadOrStore防止同一接口并发执行
2. 调度器从 `time.NewTicker` 改为 `for { run(); time.Sleep(interval) }`,前一次完成后才开始计时
## MEMORY.md 更新
- response_config 增加 `single_record` 字段说明
- prefetch 流程补充游标分页、参数构建、响应解析的详细说明
- 新增「并发保护」章节,记录内存锁和调度器时序
- 调度器章节补充 for+sleep 模式说明