Files
baiyue-firstleg/integration-service/AGENTS.md
T
2026-08-12 19:42:08 +08:00

22 lines
1.7 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.
# Integration Service 模块指引
## 职责与边界
- 负责百度 OCR、Amazon Logistics/SP-API 等第三方适配和能力开关;不保存业务主数据。
- 二期重量 OCR 由 `file/` 调用;本服务只返回识别结果,不保存 `file_object`、入库单或重量确认记录。
## 模块入口与验证
- 应用/配置:`IntegrationServiceApplication.java`、`config/IntegrationProperties.java`
- 内部接口:`controller/IntegrationProviderController.java`、`WeightOcrController.java`
- OCR 编排:`service/ocr/WeightOcrBatchService.java`、`ImageCropper.java`、`WeightCandidateSelector.java`
- 供应商适配:`provider/IntegrationProviderAdapter.java`、`BaiduOcrAdapter.java`、`AmazonLogisticsAdapter.java`
- 安全:`security/InternalServiceTokenGuard.java`;配置 `application.yml`、`../config/nacos/{local,cn}/integration-service.yml`
- 测试:`src/test/java/com/baiyue/integration/`;`mvn -pl integration-service -am test`
## 修改约束与分期
- 密钥、原始响应和客户敏感数据不得写入日志;真实调用默认关闭,适配器负责超时、重试、限流、错误归一化。
- OCR 只能访问受控输入/输出目录,接口仅接受内部服务令牌;契约变更同步检查 File 的 `WeightOcrClient` 和测试。
- 全量验收按业务链路核对通用适配、File 重量 OCR、船期外部查询及已确认的报关协作契约;外部调用必须保留来源、频率、限流、超时、最近有效结果和过期标识,凭证缺失按既定人工修正降级,不把未确认的自动化能力当作已实现契约。相关依据:`../../docs/一期/`、`../../docs/二期/`、`../../docs/三期/`。