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
|
a6f3b3060f
|
feat(core): 写操作幂等守卫与 IdempotencyStore SPI
业务键 + provider 请求键双锁:业务键不带 provider,直连与聚合器共用;
provider 键只防单 provider 内重试。
- 新增 idempotency 包:WriteScope / WriteResult / IdempotencyGuard
- 新增 SPI:IdempotencyStore 及 Claim / Record / Status 四态
- ChannelSdk.writes() 装配守卫;未注入 store 时显式失败,无降级路径
- 崩溃窗口由 provider 键恢复:平台已写但业务键未记成功时回放,不重复写
- testkit 新增 InMemoryIdempotencyStore / MutableClock,junit 改为 test 作用域
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
|
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
|
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
|
0f929a6be3
|
feat(testkit): InMemory SPI、FakeTransport 与夹具加载
- FakeTransport:按 URL 子串+方法路由,记录全部请求,可直接返回录制响应
- InMemory*:Accounts/TokenStore/CursorStore/Sink/LockProvider
- Fixtures:fixtures/{platform}/{operation}/{case}.json 约定加载
- Responses/TestData:响应与同步测试的快捷构造
目标:适配器单测不依赖网络、数据库、Spring。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
d87d9dec53
|
feat(http): HTTP 传输、JSON 编解码、签名与令牌管理模板
- HttpTransport 接口 + OkHttpTransport(连接 5s / 读 30s / 统一 UA)
- HttpRequest / HttpResponse 保留原始 header 与 body 供留痕
- JsonCodec + JacksonJsonCodec(点路径取值、数组反序列化)
- Signer 接口:签名差异收敛到各适配器
- TokenManager:按账户隔离、提前续期、LockProvider 防击穿、
刷新失败不返回旧 token、日志只打指纹
- Responses:401→Auth、429→RateLimit(带 Retry-After)、5xx→Transient、
其他 4xx→Validation
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
a6dc2d2691
|
feat(core): 领域模型、能力接口、SPI 与同步引擎骨架
- 标识体系:AccountKey(provider+platform+omsStoreId)、CanonicalKeys
三级标识(canonicalKey 不含 provider)与四类指纹
- 模型:Platform/ChannelProvider/Capability/FulfillmentMode、
Money(BigDecimal+Currency)、PlatformTime 三轴、SalesOrder/OrderLine/
ProductListing/Page/Query
- 能力接口:PlatformAdapter、AggregatorCapable、SalesOrderCapable、
ProductCapable
- 异常:ChannelException 基类 + Auth/RateLimit/Transient/Validation/
PlatformBusiness/IdempotencyConflict/CrossProviderConflict/Unsupported
- SPI:ChannelAccountRepository、SecretProvider、TokenStore、
SyncCursorStore、Sink、LockProvider(均只定义,宿主实现)
- SyncEngine:from = watermark - overlap,整批成功才推进水位线
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 |