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>
|
18 hours 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>
|
18 hours 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>
|
18 hours 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>
|
18 hours 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>
|
18 hours ago |
chenchuchuan
|
3b8c99d9b1
|
chore: 初始化 common-ecommerce 多模块骨架
四个模块:core / http / testkit / lingxing。
JDK 1.8 编译,依赖版本在 parent 统一管理,
core 仅依赖 slf4j-api,保证无第三方运行时耦合。
Co-Authored-By: Claude <noreply@anthropic.com>
|
18 hours ago |