# 变更审计记录:修复 RecordingAPIClient 缺少 post 方法 | 字段 | 值 | |------|-----| | 日期 | 2026-03-06 08:37:26 | | Prompt-ID | P20260306-083206 | | Session-ID | f1836fa4 | | Session 路径 | docs/audit/session_logs/2026-03/06/34_a8dca428_070120 | | 风险等级 | 极低 | | 影响范围 | ETL API 客户端层 | ## 操作摘要 修复 ETL 运行时错误:`RecordingAPIClient` 缺少 `post` 方法,导致 `ODS_GROUP_PACKAGE` 任务的详情拉取阶段(非预取模式)调用 `self.api.post()` 时抛出 `AttributeError`。在 `APIClient` 新增 `post()` 作为 `_post_json()` 的公共别名,在 `RecordingAPIClient` 新增 `post()` 委托给 `self.base.post()`。 ## 根因分析 - `UnifiedPipeline` 在非预取模式下调用 `self.api.post(endpoint, params)`(unified_pipeline.py:262) - `APIClient` 只有 `get()`(实际是 POST JSON 的历史命名)和私有 `_post_json()`,没有公共 `post()` 方法 - `RecordingAPIClient` 作为代理只转发了 `iter_paginated` / `get_paginated`,未覆盖 `post` - 新增的 `ODS_GROUP_PACKAGE` 详情拉取阶段首次触发了非预取模式的 `post()` 调用路径 ## 触发场景 用户从 admin-web 启动 ETL 任务,任务开始时间 2026/3/6 07:32:40,错误日志:`'RecordingAPIClient' object has no attribute 'post'` ## 验证 - getDiagnostics 两个文件均无问题 - 166 个单元测试通过(2 个 hypothesis deadline 超时与本次修改无关) ## 本次对话文件变更 ### 新增文件 - `docs/audit/prompt_logs/prompt_log_20260306_083206.md` - `docs/audit/session_logs/2026-03/06/34_a8dca428_070120/main_02_f1836fa4.md` - `docs/audit/session_logs/2026-03/06/34_a8dca428_070120/sub_01_f1836fa4.md` - `docs/audit/session_logs/2026-03/06/37_e5276b93_082544/main_06_dfa80d9e.md` ## 改动注解 ### `apps/etl/connectors/feiqiu/api/client.py` - 变更类型:修改 - 原始原因:`APIClient` 缺少公共 `post()` 方法,导致 `UnifiedPipeline` 在详情拉取模式下调用失败 - 思路分析:`get()` 方法实际执行 POST JSON 请求(历史命名),新增 `post()` 作为 `_post_json()` 的语义明确别名,与 `get()` 平行放置,不改变任何请求逻辑 - 修改结果:`APIClient` 公共接口补齐 `post()` 方法,所有通过 `APIClient` 或其代理发起的非分页 POST 请求均可正常工作 ### `apps/etl/connectors/feiqiu/api/recording_client.py` - 变更类型:修改 - 原始原因:`RecordingAPIClient` 作为 `APIClient` 的代理,未转发 `post()` 方法,导致详情拉取阶段 `AttributeError` - 思路分析:与已有的 `iter_paginated` / `get_paginated` 代理模式一致,新增 `post()` 直接委托给 `self.base.post()`。详情请求不需要落盘(非分页数据),因此不做额外录制 - 修改结果:`RecordingAPIClient` 完整覆盖 `APIClient` 的公共接口,`UnifiedPipeline` 在在线拉取模式下可正常调用 `self.api.post()`