chenchuchuan
|
20d6bbe975
|
refactor(lingxing): 搭子平台分派骨架,删除全部假数据
结构:
- 新增 LingxingApi 枚举:路径 + 限流,一条路径只写一次
- 新增 platform/ 包:LingxingSubPlatform 接口、LingxingSubPlatforms 注册表、
LingxingCall 调用上下文、walmart/WalmartSubPlatform 首个实现
- LingxingAdapter.pull 改为按 Platform 分派,supports 委托子平台
删除假数据:
- LingxingApi 里凭空猜测的 SHOP_LIST_* / PRODUCT_LIST_* 路径
- LingxingAdapter.listSubChannels 由账户拼出的假子渠道,改为显式抛异常
- LingxingConstants 中与 LingxingApi 重复的路径与限流常量
- README / GUIDE 中已删除的 FakeTransport、Fixtures 相关内容
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
54877562d1
|
refactor(sdk): 连接信息改由调用方每次传入,SDK 不保存
端点与凭据此前固化成常量或注入的 SecretProvider,等于 SDK 在替宿主保存连接配置。
现在改为调用方每次调用显式传入:
- 新增 ChannelConnection(endpointBaseUrl + ChannelSecret)
- ChannelContext 持有 connection;新增 endpointBaseUrl() / secret()
- ChannelSdk.salesOrders(key, conn) / products(key, conn) 必须传连接
- LingxingAdapter 构造函数不再接收 baseUrl 与 SecretProvider
- LingxingRequestFactory 的 baseUrl 改为每次 post 传入
- LingxingTokenClient.fetch(baseUrl, appId, appSecret)
- ChannelSecret 增加 endpointBaseUrl:TokenManager 的 refresh 回调只拿得到凭据对象
- LingxingConstants.DEFAULT_BASE_URL 改名 PRODUCTION_BASE_URL,明确仅作参考/测试常量
TokenManager 仍按设计文档 9.1 管理 token 生命周期(缓存、提前续期、防击穿、
失效重取),token 存储仍走宿主 TokenStore SPI——文档没要求 SDK 自己存。
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
|
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
|
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
|
9341181936
|
feat(core): ChannelSdk 门面、ProviderResolver 与能力视图
修复空壳门面可被 build 出来的问题:
- ChannelSdk.build() 强校验 accountRepository、clock、至少一个适配器,
缺项直接抛 IllegalStateException,不再返回不可用的空对象
- 同一 provider+platform 重复注册适配器时报错
- ProviderResolver:按 AccountKey 解析,无适配器时显式失败
- 能力视图 SalesOrders / Products:调用前做能力检查,
缺失抛 UnsupportedCapabilityException
- CapabilityReport + AdapterCapabilityReport:逐项询问 supports(),
聚合器可给出子平台级精确结果
- 支持 register(AdapterFactory) 与 register(Adapter) 两种注册方式
- ChannelSdkTest 9 个用例覆盖 build 校验、路由、能力检查
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
3f0d424dcd
|
docs: README 补充包职责、调用方式与扩展方式
- 一、包职责:model/capability/error/sdk/sync/spi/http/testkit/lingxing
逐项说明,标注 UnsupportedCapabilityException 与同名 Responses 的坑
- 二、标识体系:canonicalKey / sourceKey / 双锁幂等键的使用
- 三、调用方式:单次查询、SyncEngine 增量同步、门面目标形态(标注未实现)、
能力检查
- 四、扩展方式:新增直连平台 7 步、新增聚合器、新增能力、新增 SPI,
以及扩展红线
- 五、测试:分层、夹具约定、FakeTransport 写法、执行命令
- 六、待办与待核对清单
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 |