chenchuchuan
|
96f6621bbd
|
refactor: 按 Spec W0 拆分 sdk-common / channel-sdk-core,http 并入 sdk-common
模块更名与上提(Spec W0 §11):
- shared → sdk-common,http 合并进来,channel-sdk-http 取消
- channel → channel-sdk-core,testkit → sdk-testkit
- 父 POM 更名为 channel-sdk-parent
共享层为跨域复用做的三处调整:
- IdempotencyStore / IdempotencyRecord 的 provider 改为 String,
渠道域与仓库域两套 provider 枚举落同一张幂等表
- 新增 WriteIdentity,WriteScope 实现它;幂等守卫改为面向接口
- CallSupport 从 channel 移到 sdk-common,新增 CallScope;
ChannelContext 实现 CallScope,耗时与埋点维度不再绑定渠道域
ChannelProvider 里误加的 YUNQUNA 移除:仓不是渠道,走 WarehouseProvider。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
8bca2bff73
|
refactor: 模块更名 shared/channel,README 补架构图
- common → shared(跨域共享层),core → channel(渠道域),
包名同步为 common.ecommerce.shared.* / common.ecommerce.channel.*
- GUIDE / 操作手册 的 Maven 坐标随之更新
- README 增加架构图:分层依赖、模块依赖、一次查询的调用链;
包职责表与 lingxing 适配器结构对齐当前实现
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
c9d60153c7
|
test: 每个平台补 listing / 售后契约测试,新增 SDK 门面调用测试
testkit(测试支撑):
- RecordingTransport:记录全部请求、按 URL 路由响应;令牌请求自动返回最小成功响应,
业务请求可断言
- JsonFixture:classpath 夹具加载
- Responses:恢复快捷响应构造
- FakeDirectAdapter:补 AfterSaleCapable,支持 afterSales(count)
lingxing(每平台一套):
- 9 个 listing 测试:walmart / ebay / temu / shein / tiktok / target /
aliexpress / amazon sc / amazon vc
覆盖请求参数(店铺、时间窗、分页、搜索编码)与响应映射
- 售后:ListSource(请求构造、过滤、上限、时间窗校验、行展开)+ Mapper(10 例)
- LingxingTestSupport:测试公共样板(账户/调用/断言)
- 夹具:每平台一套 success.json
testkit(门面调用):
- SdkFacadeCallTest:products / afterSales / salesOrders 的完整调用、分页、
参数校验、能力检查、账户缺失等错误路径
清理:
- 删除 ProductCallExampleTest、SdkCallGuideTest 与两份 AmazonScProductLiveTest
(已被上述测试覆盖)
- 探针改为 -Dlingxing.probe=true 才运行,避免真实凭证让 mvn test 变红
修复:
- TargetProductSource 的 store_ids 被误注释,恢复
- AmazonVcProductSource 传搜索条件时显式抛异常,不再静默忽略
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
f6d301b16d
|
test(lingxing): 移除假响应测试,保留真实环境冒烟
按要求只测真实接口,删除依赖录制报文的部分:
- LingxingAdapterTest / LingxingTokenClientTest / LingxingOrderMapperTest
- fixtures/lingxing 下全部夹具
- testkit 的 FakeTransport / Fixtures / Responses
保留 LingxingLiveSmokeTest(未配环境变量整类跳过),
以及不涉及网络用例(Signer / Envelope / RateLimiter / RequestFactory)。
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
|
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 |