chenchuchuan
|
37cc2dbc58
|
fix(lingxing): 令牌接口按官方文档修正出入参
原实现与文档不符,联调时必然失败。
入参:
- Content-Type 由 application/json 改为 multipart/form-data(文档要求,curl 用 --form)
- HttpRequest 新增 contentType 字段,OkHttpTransport 按类型选择 MediaType;
未指定时保持 JSON,不影响其它请求
出参:
- 先校验业务码 code == "200",失败抛 AuthException 并带 msg(HTTP 层仍返回 200)
- expires_in 按文档为秒,expiresAt 改用注入的 Clock 计算(原来用 Instant.now())
- 删除 data.0.access_token / 顶层 access_token 的猜测性兜底
- 缺 access_token 时抛带上下文的 AuthException,而不是 NullPointerException
测试:
- 新增 LingxingTokenClientTest,覆盖 multipart 构造、成功解析、业务错误码、
缺 token、HTTP 5xx 五条路径
- token 夹具改为文档示例结构(code 为字符串 "200"),新增 auth_failed 夹具
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
8560c2ea47
|
build(lingxing): DTO 使用 Lombok 生成访问器
两个领星 DTO 是纯数据容器,访问器占 47 行样板代码。改用 @Getter/@Setter 后:
- LingxingOrderDto 196 → 82 行
- LingxingOrderItemDto 88 → 40 行
范围限定在 lingxing/dto:core 的领域模型是不可变 + Builder,不使用 Lombok。
依赖 scope=provided,不进宿主运行时。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
3140aaf328
|
chore: 删除重构遗留的 apelet 旧包目录
包名迁移时旧路径下的 79 个文件未被移除,形成新旧两套源码并存。
旧文件内容仍是改名前版本(包声明为 apelet.common.ecommerce),
且与新路径文件功能重复。删除后 src 下仅保留 common.ecommerce。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
b694116aa6
|
build: Maven groupId 改为 ecommerce
Java 包名去掉 apelet 前缀后,Maven 坐标同步对齐。
- 根 pom 与四个子模块的 groupId、parent、依赖坐标
- GUIDE 第三章示例中的 groupId
- README 移除「groupId 待处理」事项
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
b305fd9608
|
docs: 新增开发指南与领星真实环境冒烟测试
- GUIDE.md:心智模型、基接口逐个讲、三条流水线、接入新平台 8 步、5 层测试、验收清单
- LingxingLiveSmokeTest:未配置环境变量时整类跳过,先验认证再验报文,打印脱敏请求响应
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
9e6b8c5c61
|
refactor(capability): 详情参数改用 SalesOrderRef / ProductRef
裸 String 在擦除后使 SalesOrderCapable.get 与 ProductCapable.get 签名相同,
一个适配器无法同时实现订单与商品两种能力。改为包装类型后两者可共存。
- 新增 common.ecommerce.model.order.SalesOrderRef / model.product.ProductRef
- SalesOrderCapable / ProductCapable 的 get 参数改为引用类型
- 门面 SalesOrders.get(String) / Products.get(String) 对外签名不变
- LingxingAdapter、ChannelSdkTest 同步适配
- testkit 新增 FakeDirectAdapter 及其测试,验证 core 抽象未被聚合器带偏
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
ff9ec456c2
|
refactor: 包名去掉 apelet 前缀并按职责拆分 model 子包
- 包路径 apelet.common.ecommerce → common.ecommerce(四个模块的 main/test 全量迁移)
- model 拆为 account / order / product / support 四个子包,枚举留在根包
- 同步更新 README 包结构与导入路径
行为无变化,仅重命名与目录调整。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
b7e6df462a
|
feat(lingxing): 领星订单拉取适配器
- LingxingAdapter:SalesOrderCapable + AggregatorCapable,
按 platform_code 细化能力(eBay/SHEIN/Mirakl/自定义平台只有订单)
- LingxingSigner:公共参数 ASCII 升序拼接 appSecret 前后包裹后 MD5
- LingxingTokenClient + TokenManager:约 2h 令牌,提前 10 分钟续期
- 时间窗 ≤31 天截断、length ≤500、offset 游标、10 req/s 令牌桶
- channelOrderId 优先平台单号,platform_order_names 排序取首,缺失回落领星 order_id
- LingxingAdapterFactory:与直连适配器同一套注册机制
契约测试 16 个,全部基于录制夹具,无网络/数据库/Spring。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
3b8c99d9b1
|
chore: 初始化 common-ecommerce 多模块骨架
四个模块:core / http / testkit / lingxing。
JDK 1.8 编译,依赖版本在 parent 统一管理,
core 仅依赖 slf4j-api,保证无第三方运行时耦合。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |