lml
|
14b09069d1
|
feat(lingxing): 接入多平台店铺与订单查询并补齐长尾平台
- 多平台店铺列表按子平台声明的业务平台返回子渠道,不再由 platform_code 反推
- 抽出 MultiPlatformOrderSource,统一复用 /pb/mp/order/v2/list
- 为 Temu / SHEIN / Shopify / eBay / AliExpress / TikTok 补 shopSource 与 orderSource
- 新增 Target / Wayfair / Mirakl / BestBuy / AEPH / Michaels / ECHO / LOS-DLI-US / CUSTOM 子平台并注册
- supports 改用 AccountKey.platform 判定;platforms() 补齐新平台;toPlatform 补 10002/10005/10010/10029/10030
- 新增 LingxingOrderFilters 与 LingxingAdapter.pull(ctx, query, filters),覆盖平台单号、跟踪号、订单状态等全部查询条件
- 按平台单号/名称查询时自动省略时间窗;时间窗截断 31 天、分页截断 500
- 补全订单 DTO 并新增物流、标签、子产品 DTO,全部中文注释;SalesOrderQuery 补语义注释
- .gitignore 的 Maven target 改为锚定写法,避免忽略 platform/target 包
|
2 weeks ago |
chenchuchuan
|
6214462ba9
|
feat(lingxing): 接入售后订单列表
core:
- 新增 model/aftersale:AfterSaleType(REFUND/RETURN/EXCHANGE/UNKNOWN)、
AfterSaleQuery(时间窗必填、dateType、类型与订单号过滤)、AfterSale(按商品行展开)
- 新增 AfterSaleCapable + AfterSales 视图,ChannelSdk.afterSales(key, conn)
lingxing:
- LingxingApi.AFTER_SALE_LIST
/erp/sc/routing/amzod/order/afterSaleList(POST, qps 1)
- platform/aftersale:DTO(订单级 + item_list 行级 + 金额明细)、Mapper、ListSource
- AmazonScSubPlatform 装配 afterSaleSource;适配器声明 RETURNS 能力
映射要点:
- 领星按订单聚合,统一模型按 item_list 商品行展开
- 分页游标按「领星记录数」推进,不用展开后的条目数
- 行级 after_time / data_update_time 优先于订单级
- 唯一标识优先 md5_v2 → item_identifier → 订单号+msku+时间+row_index
- 金额只保留数字与符号位;币种按符号映射,映射不出则金额为 null
- 兼容文档笔误:示例里的 total_refund_amount__number(双下划线)
测试:Mapper 10 例 + 请求构造 1 例,夹具用官方文档示例。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
fdc55b3f54
|
feat(product): SKU 搜索条件(平台 SKU / 本地 SKU)
SDK 层(core):
- 新增 ProductSearchField:PLATFORM_SKU / LOCAL_SKU,只定义跨平台语义一致的维度
- ProductQuery 增加 searchField / searchValue(单值模糊)/ searchValues(多值精确)
- 有搜索值但没 searchField 直接抛异常
- 单值与多值互斥,同时设置直接抛异常
- 新增 hasSearch() 与 toBuilder()
领星层(lingxing):
- LingxingProductSearchMapper:语义 → 平台枚举值
沃尔玛/eBay 1 / 3
AliExpress 1 / 5 (实测;文档写 3 但查不到)
Temu/SHEIN/TikTok 9 / 8
Shopify/Target 1 / 本地 SKU 待核对
亚马逊 SC "seller_sku" / "sku"(字符串)
- LingxingProductSearchBody:三种请求形态
camelCase(沃尔玛/eBay/Temu/SHEIN/TikTok/AliExpress)
snake_case(Shopify/Target)
amazonSc:search_value 数组 + exact_search 开关
- 八个商品 Source 接入;平台不支持的维度抛 ValidationException,不静默忽略
亚马逊 VC 不支持搜索(接入时会因 Mapper 抛异常而显式失败)。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
a37d1fe91a
|
fix(lingxing): 能力判断直接用 account.platform(),不再从 platformCode 反推
supports(account, capability) 之前用 LingxingConstants.toPlatform(platformCode)
反推平台,但 account 的 key 里本来就有调用方传入的 Platform。
两者不一致时(如 platformCode=10024 但 platform=WALMART_SC)会出现
「路由走 A、能力判断走 B」的错乱。现在统一以调用方传入的 Platform 为准,
platformCode 只用于拼请求参数。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
9df007eeb8
|
fix(lingxing): 按真实店铺列表修正 platform_code 映射
以 88 家真实店铺(/pb/mp/shop/v2/getSellerList)为准确认:
新增映射:
- 10002 → SHOPIFY(SPF-*)
- 10005 / 10031 → AEPH(AEP-* / AEPH-*)
刻意保持 CUSTOM:
- 10009 自定义平台:混有 WOT / MIC / BSB / TTK 及事业部命名,无法用一个枚举表示
- 10010 Wayfair:统一模型暂无枚举
- 10017:同时存在 Target DVS 与 WMT-1P-US,业务平台不同
注释补充:Target 没有独立商品接口,商品走 Shopify 的
/basicOpen/multiplatform/shopify/variantList,该接口由 Shopify 与 Target 共用。
另:实测 88 家店中没有 AliExpress 店铺,10002 是 Shopify。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
a4ba27e715
|
refactor(lingxing): 领星 shopify 接口按 Target 平台对接;店铺过滤改为可选
平台改名:
- platform/shopify/ → platform/target/
- ShopifySubPlatform / ShopifyProductSource / ShopifyListingDto / ShopifyLocationDto
→ Target* 系列
- Platform.SHOPIFY 保留(供直连场景),领星侧改用 Platform.TARGET
- 领星接口路径不变(/basicOpen/multiplatform/shopify/variantList)
店铺过滤:
- 各商品 Source 不再无条件拼 store_ids / storeIds / sid / vc_store_ids
- 账户 externalStoreId 为空时不传,由平台侧校验是否必填;
SDK 不做上层校验,只负责透传
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
lml
|
23a08e4e9d
|
feat(lingxing): 接入销售出库单、物流面单、审核发货与编辑订单
新增 4 个 ERP 级接口,均复用 LingxingCall:
- POST /erp/sc/routing/wms/order/wmsOrderList
- POST /erp/sc/routing/wms/order/getWmsLogisticsLabels
- POST /basicOpen/openapi/multiplatform/order/review
- POST /pb/mp/order/editOrder
core:
- Capability 新增 OUTBOUND_ORDER / ORDER_EDIT / SHIPMENT_REVIEW
- 新增 OutboundOrderCapable / ShippingLabelCapable /
ShipmentReviewCapable / OrderEditCapable
- Outbounds 扩展出库单、面单、审核发货;SalesOrders 扩展编辑订单
- 新增出库单、面单、审核结果、编辑请求/结果等不可变模型
lingxing:
- 补充 4 条接口路径与分页、批量上限
- wms 包下新增 4 个 Source 与对应 DTO
- LingxingAdapter 装配 4 个 Source 并声明对应能力
注意事项:
- editOrder 的 code 0/10000/10001 都是业务结果,不能走 LingxingEnvelope,
逐单原因在 data.error_details[],且 global_order_no 按字符串解析
- 出库单默认按账户 externalStoreId 过滤,非数字时显式失败,
避免不带 sid_arr 时跨店铺返回数据
- 面单 wo_number_arr 与 order_number_arr 二选一,单次上限 50
- 商品行 currency_code 可能是符号而非 ISO 代码,此时不构造 Money
- 编辑订单独立成 Capability.ORDER_EDIT:ERP 级接口,
不依赖子平台的订单列表能力
|
2 weeks ago |
chenchuchuan
|
ee75c199b3
|
docs(sdk): 补齐 ChannelSdk / ChannelConnection / ChannelSecret 字段注释;新增拉商品示例
ChannelSdk:
- 类注释改成「构建需要三样 + 每次调用需要两样」+ 调用链图
- 每个字段、每个 Builder 方法、每个门面方法补注释(含异常说明)
- 明确能力检查发生在 pull() 调用时,不是取视图时
- 明确 clock 的作用(查询终点 + 幂等时间戳)与生产是否要传
ChannelConnection / ChannelSecret:
- endpointBaseUrl / appKey / appSecret / clientId / clientSecret / refreshToken
逐个注明是哪个平台用
新增 ProductCallExampleTest(拉商品):
- 三段配置分别是什么、拼出的请求长什么样、结果如何映射
- 传输层返回一页固定响应,不联网
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
8596e34936
|
docs(lingxing): 标注快速出库为写操作,验证阶段禁止调用
领星无测试环境,出库会真实改变数据:
- LingxingApi.FAST_OUTBOUND 注释标明写操作,禁止验证
- MultiPlatformOutboundSource 类注释与 submit 方法注释同步标注
- FAST_OUTBOUND_RESULT 注明只读、可安全验证
约定已记入项目记忆:领星验证只做查询。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
831cd71ce2
|
test(lingxing): 新增从 ChannelSdk 调用领星的用法演示测试
六个步骤对应操作手册的调用顺序:
1. 构造 ChannelAccount(provider/platform/omsStoreId + externalStoreId + platformCode)
2. 构造 ChannelConnection(端点 + appId/appSecret)
3. 构建 ChannelSdk(accountRepository 必需;工厂或适配器实例注册)
4. capabilities() 不发网络请求
5. pull 时打印并断言真实请求:先换 token,再拉订单,含 platform_code/store_id/offset/length/时间窗
6. 三类快速失败:账户未配置、能力缺失(在调用动作时报错)、平台无适配器
注意:领星 appId 同时作为签名 AES 密钥,测试里必须是 16/24/32 字节。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
e13d86a32d
|
refactor(lingxing): 能力接口不再分包,统一放在 platform 根包
之前每个能力一个子包(order/、product/、shop/、settlement/、outbound/),
实际每个包里只有一个接口,增加了跳转层级。
现在统一放在 platform 根包:
- LingxingOrderSource / LingxingProductSource / LingxingShopSource /
LingxingSettlementSource / LingxingOutboundSource
根包现有 9 个类:5 个能力接口 + LingxingSubPlatform(组合入口)
+ LingxingSubPlatforms(注册表)+ LingxingSubPlatformDefaults(默认装配)
+ LingxingCall(调用上下文)。
子平台实现仍在各自包内(amazon/sc/order 等),保持按平台组织。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
f3aefee1d3
|
refactor(lingxing): 子平台注册表改为实例级;接入快速出库
注册表(方案 A):
- LingxingSubPlatforms 从全局静态改成 builder().register(...).build()
- 同一平台重复注册在 build() 时抛异常,不再静默覆盖
- 新增 LingxingSubPlatformDefaults.all(transport, json) 装配默认实现
- LingxingAdapter 持有注册表实例;新增可注入注册表的构造器,
传 null 时用默认装配
- 路由第一层仍由调用方传入的 AccountKey(provider + platform)决定
快速出库(多平台通用,qps 10):
- LingxingApi 新增 FAST_OUTBOUND / FAST_OUTBOUND_RESULT
- core 新增 OutboundCapable / Outbounds / OutboundPackage / OutboundResult
- ChannelSdk 新增 outbounds(key, conn)
- 新增 platform/outbound/LingxingOutboundSource 能力接口
- 新增 platform/multiplatform/outbound/MultiPlatformOutboundSource
(两个接口都不带平台维度,所有子平台共用)
- 九个多平台子平台声明 outboundSource()
- 适配器 capabilities() 增加 MARK_SHIPPED,supports() 按 outboundSource 判定
注意:submit 仅表示任务受理,结果需用 results() 回查。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
04388e1b44
|
fix(merge): 合并后去除重复实现,补齐 VC 订单能力
重复实现(合并分支与本分支各写了一份):
- amazon/vc/shop:VcShopSource 与 AmazonVcShopSource 重复,
保留带内部翻页的 VcShopSource,删除 AmazonVcShopSource;
同时去掉它按 status==1 过滤的行为(统一遵守“只转发”约定)
- amazon/vc/dto:删除不再引用的 AmazonVcShopDto
补齐:
- AmazonVcSubPlatform 接上 VcOrderSource(合并分支已实现 VC 订单,
但子平台未声明),现在 VC 支持 订单/商品/店铺 三项
全库已无同名重复类,BUILD SUCCESS。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
027346b26a
|
fix(merge): 修复合并冲突残留,统一 amazon 目录归属
合并带来的问题:
- amazon/ 下出现根包与 sc/vc 子包两套同名类(AmazonVcSubPlatform、
AmazonProductSource、AmazonShopSource、6 个订单 DTO),其中 sc/dto 下
是 0 字节冲突残留
- AmazonListingDto(更早的 14 字段版本)与 AmazonScListingDto(59 字段)
重复,删除旧版
- WalmartListingDto 合并时 itemId 字段重复声明
- AmazonFbmOrderSource 引用 dto 包,FbmOrderDetailDto 引用 FbmOrderItemDto
缺少 import
- LingxingSubPlatforms 仍指向合并前的 amazon.AmazonScSubPlatform /
amazon.AmazonVcSubPlatform
整理结果:
- 亚马逊订单/结算 DTO → amazon/sc/dto(Header 说 sc 专属)
- FBM 订单列表 DTO → amazon/dto(被 amazon/order 下的 Source 使用)
- 删除根包下重复的 AmazonVcSubPlatform / AmazonProductSource / AmazonShopSource
与 0 字节冲突文件
- 注册表改用 amazon.sc / amazon.vc 子包
Co-Authored-By: Claude <noreply@anthropic.com>
|
2 weeks ago |
chenchuchuan
|
b0f7235025
|
Merge branch 'feature/supplier-lingxing' of http://124.222.6.97:3000/chencc/common-ecommerce into feature/supplier-lingxing
# Conflicts:
# lingxing/src/main/java/common/ecommerce/lingxing/LingxingApi.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/LingxingSubPlatforms.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/AmazonShopSource.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/AmazonScSubPlatform.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/AmazonOrderDetailDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/AmazonOrderDetailItemDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/AmazonOrderDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/AmazonOrderItemDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/AmazonSettlementTransactionDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/FbmOrderDetailDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/FbmOrderDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/sc/dto/FbmOrderItemDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/walmart/WalmartSubPlatform.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/walmart/dto/WalmartListingDto.java
# lingxing/src/main/java/common/ecommerce/lingxing/platform/walmart/product/WalmartProductSource.java
|
3 weeks ago |
chenchuchuan
|
883ed60c21
|
refactor(lingxing): 价格不做兜底与计算,只做单位/币种换算
SDK 只做整合转发,不替调用方挑选数据:
- Temu:接口没有独立价格字段(只有 supplyPriceList 分段申报价),
price / currency 直接为 null,原值保留在 attributes
- SHEIN:只取 salePrice + saleCurrency,去掉 supplyPriceList 兜底
- AliExpress:此前已改为只取 price(分 ÷ 100)
同时删除不再使用的 currentSupplyPrice / currencyOf / moneyOrNull 辅助方法。
约定已记入项目记忆。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
lml
|
2bbc5e3cf3
|
feat(lingxing): 接入多平台店铺与 Walmart 在线商品
- 新增 MultiPlatformShopSource:
/pb/mp/shop/v2/getSellerList,offset/length 内部翻页,
按 platform_code + is_sync/status 过滤
- 新增 WalmartProductSource:
/basicOpen/multiplatform/walmart/list,更新时间窗 ≤31 天,
兼容 data.list 与 data[] 两种响应
- WalmartSubPlatform 装配 shopSource / productSource
- LingxingApi 增加两个接口枚举,常量补分页与窗口上限
- smoke 增加 Walmart 店铺 → 商品链路
说明:
- Walmart 商品接口没有返回更新时间,ProductListing.updatedAt 暂为 null
- listing 日期参数文档未标时区,按北京时间解析,待真实报文核对
|
3 weeks ago |
chenchuchuan
|
f832091558
|
style(lingxing): 单行语句不再硬拆多行;AliExpress price 只做单位换算
代码风格:
- 按用户要求,能放一行的语句不拆成两行
(listAt(...)、body.put(...)、字段初始化等 11 处)
AliExpress 价格:
- 统一模型 price 只取接口自身的 price 字段(单位:分)÷ 100
- 不再用 effectiveSupplyPrice 或 supplyPriceList 替代 / 兜底
- 删除不再使用的 currentSupplyPrice 辅助方法
约定已记入项目记忆:价格只做单位换算,缺字段给 null,原始值留在 attributes。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
2ff213e3c4
|
fix(aliexpress): price 单位按分换算为标准金额
接口 price 字段单位为分,统一模型用标准金额(元),除以 100 后输出。
取值优先级:
1. effectiveSupplyPrice(已格式化的字符串,直接可用)
2. price(分)÷ 100
3. 当前生效的 supplyPriceList 条目
文档示例 99990000 与 effectiveSupplyPrice 59.99 不一致,按「单位分」处理;
原始 price 仍保留在 attributes.price。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
lml
|
6a7cbf765d
|
feat(lingxing): 接入亚马逊 VC 店铺与订单
- 新增 AmazonVcSubPlatform,注册 AMAZON_VC(platform_code 10035)
- VcShopSource:/basicOpen/platformAuth/vcSeller/pageList,
offset/length 内部翻页,只保留 status=1 的店铺
- VcOrderSource:/basicOpen/platformOrder/vcOrder/pageList,
purchase_order_type=[0,1,2],search_field_time=3,窗口 ≤90 天
- 详情按类型分派:DF 用 vc_store_id + purchase_order_number,
PO 用 local_po_number;DI 无详情,回退列表数据
- get() 先按订单编号搜索拿类型与 local_po_number,再调对应详情
- 新增 VC 店铺/订单 DTO 与冒烟用例
说明:purchase_order_date 文档未标时区,暂按北京时间解析,待真实报文核对
|
3 weeks ago |
chenchuchuan
|
3dd0188d39
|
feat(lingxing): 接入 AliExpress / SHEIN / TikTok 在线商品
接口(均为 POST、qps 1、返回 data.list):
- AliExpress /basicOpen/multiplatform/aliexpress/list/v2(托管模式,isParent=0 子体)
- SHEIN /basicOpen/multiplatform/shein/list(上限 1000)
- TikTok /basicOpen/multiplatform/tiktok/list(上限 1000)
映射要点:
- 三者 platformSku 均取 msku,listingId 取 productUniqueId
- AliExpress:price 取 effectiveSupplyPrice + currencyCode;
createTime 是北京时间,按 Asia/Shanghai 解析;storeIds 尽量传数字
- SHEIN:salePrice + saleCurrency;图片依次回落 imgUrl/imgMediumUrl/imgSmallUrl;
status 0 删除 / 1 在售 / 2 停售
- TikTok:salesPrice + currency;title 为空时回落 pname;
platformStatus 字符串归一,兼容示例中的无下划线写法 SELLERDEACTIVATED
Platform 新增 ALIEXPRESS,适配器与工厂的 platforms() 同步;
LingxingSubPlatforms 注册三个子平台。
其余字段全部进 attributes。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
lml
|
4f7f9c88a5
|
feat(lingxing): 接入亚马逊订单、FBM 与结算交易明细
- 亚马逊 SC 标准订单:platform_code=10001 走 /erp/sc/data/mws/orders,
date_type=3(平台更新时间 UTC),窗口 ≤1 年,分页 ≤5000,1 req/s
- 亚马逊订单详情:/erp/sc/data/mws/orderDetail,返回单价/税额/折扣;
get() 按子平台分派,不再统一抛未实现
- 亚马逊店铺列表:GET /erp/sc/data/seller/lists,
返回的 sid 可直接作为 externalStoreId
- 亚马逊 FBM:getOrderList/getOrderDetail 单独成一路,主键是领星系统单号
order_number,列表 page 从 1 开始,详情 data 是对象
- 结算交易明细:新增 SettlementCapable / Settlements 门面与结算模型,
接口 /bd/sp/api/open/settlement/transaction/detail/list,
结算窗口 ≤7 天,修改时间按北京时间
- LingxingSubPlatform 增加 fbmOrderSource / settlementSource
- LingxingApi 统一登记接口路径与令牌桶
- 金额清洗复用 LingxingOrderMapper.cleanAmount
- smoke 测试覆盖店铺 → 订单 → 详情 → FBM → 结算链路
说明:
- FBM purchase_time 文档未标时区,暂按北京时间解析,待真实报文核对
- 结算 eventType=ServiceFeeEventList 时 uniqueKey 会变,需先删后写
|
3 weeks ago |
chenchuchuan
|
f3f7e08019
|
feat(lingxing): 接入 eBay 在线商品
接口 /basicOpen/multiplatform/ebay/list(POST, qps 1, 上限 200):
- 响应是 data 数组(不是 data.list),总数在顶层 total
- 时间过滤精度 Y-m-d,查询类型取创建时间(1),区间超 31 天截断
- EbayListingDto 全字段 + 嵌套 product_auto_restock_response
映射要点:
- platformSku ← msku,为空串时回落 item_id(保证 canonicalKey 有值)
- listingId ← item_id
- status ← listing_status(1 在售,其余文档未列,归 UNKNOWN)
- rawStatus ← listing_status_name(中文,如「在售」)
- 接口不返回币种,price / currency 均为 null,原值在 attributes.price
其余字段全部进 attributes(变体属性、站点、销售类型、起拍价/一口价、
自动补货规则、所在地、处理时间等)。
Shopify 此前已接入,本次文档与其一致,无需改动。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
6a22e9057c
|
fix(lingxing): ¥ 符号统一按日元处理,CNY 视为人民币
约定:渠道只给货币符号时,¥ / ¥ 一律映射 JPY;
人民币由平台以 ISO 代码 CNY(或 RMB)返回,显式映射 CNY。
涉及 SC 之外的全部商品实现:
- AmazonVcProductSource
- WalmartProductSource
- TemuProductSource
- ShopifyProductSource
此前 ¥ 返回 null 导致价格被置空,现可正常落库。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
dfb9ab34c0
|
feat(lingxing): 接入 Temu 与 Shopify 在线商品
Temu(/basicOpen/multiplatform/temu/list, POST, qps 1, 上限 1000):
- TemuListingDto 全字段 + 嵌套 wareHouseDataList / supplyPriceList / promotionalPriceDataList
- 固定 offset 分页(useCursor=false);总数取 data.count
- 时间窗 updateStartTime/updateEndTime 按 UTC 发送
- 映射:msku→platformSku、productUniqueId→listingId、imgUrl→imageUrls、
status(0 删除/2 正常)、当前生效申报价→price(币种符号 ¥ 无法判定时不填金额)
- 其余进 attributes(SKC/SPU、仓库库存、活动价、JIT、selectStatus 等)
Shopify(/basicOpen/multiplatform/shopify/variantList, POST, qps 1, 上限 1000):
- ShopifyListingDto 全字段 + location_infos 嵌套
- 映射:msku→platformSku、product_unique_id→listingId、
picture_url||parent_picture_url→imageUrls、status 1/2/3/4 归一、
price + currency_icon、listing_start_time→listedAt
- 其余进 attributes
Platform 新增 SHOPIFY,并在适配器与工厂的 platforms() 中登记;
LingxingSubPlatforms 注册 TemuSubPlatform / ShopifySubPlatform。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
2a046d4e9e
|
feat(lingxing): 沃尔玛在线商品;店铺列表不再按状态过滤
沃尔玛商品(/basicOpen/multiplatform/walmart/list, POST, qps 1, 上限 200):
- WalmartListingDto:34 个字段全覆盖(文档标注均为必填)
- WalmartProductSource:store_ids 传数组;时间窗按 Y-m-d,字段类型取更新时间(2),
超 31 天截断;响应在 data.list
- 映射:msku→platformSku、item_id→listingId、gtin/upc→gtin、picture_url→imageUrls、
status_name 按名称归一、price + currency_icon 反推币种、
offer_start_date→listedAt、listing_start_time→updatedAt
- 其余字段全部进 attributes
- WalmartSubPlatform 注册 productSource
店铺列表:
- 移除 SC / VC 的 status != 1 过滤,SDK 只转发
- 调用方按 SubChannel.status() 自行决定可用性
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
a4135f5862
|
feat(shop): SubChannel 补齐店铺标准字段,SC/VC 全字段映射
SubChannel 新增(均有注释说明对应领星字段):
- sellerId SC/VC 的 seller_id
- accountName account_name
- status 原始授权状态(不再只保留正常店铺后在结果里丢失状态)
- region SC/VC 的 region,如 na / eu
- regionName VC 的 region_name,如 北美洲
- country SC 的 country
- marketplaceId SC 的 marketplace_id
- marketplaceNum mid
- attributes 其余平台特有字段(seller_account_id / has_ads_setting / account_id)
保留旧的四参构造器,已有调用方无需改动;新增 Builder 便于扩展。
用途:调用方构造 ChannelAccount 时可直接从 SubChannel 取 region/country,
不必再硬编码 marketplaceZone。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
e940945174
|
feat(product): ProductListing 扩充标准字段,SC/VC 全字段映射
统一模型新增(都有注释说明对应哪个平台字段):
- platform:业务平台,落库时不必再反查账户
- listingId / asin / parentAsin / gtin:平台商品标识
- attributes:未标准化的原始字段(本地 SKU、库存、费用、排名、尺寸等)
- status 改为枚举 ProductStatus(ACTIVE/INACTIVE/DELETED/UNKNOWN),
rawStatus 保留平台原值
SC 映射:seller_sku / listing_id / asin / item_name / small_image_url /
status+is_delete / price+currency_code / on_sale_time / listing_update_date,
其余 40+ 字段进 attributes。
VC 映射:msku / asin / parent_asin / upc|ean / item_name / small_min_image_url /
status / price,其余进 attributes。
VC 只给货币符号不给 ISO 代码,按符号反推,反推不出时 currency 与 price 都为 null;
¥ 因人民币与日元无法区分,一律返回 null。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
707ecd3e11
|
refactor(lingxing): 亚马逊 SC / VC 分包,补齐能力子目录
之前 SC 的文件直接放在 amazon/ 下、VC 混着 AmazonVc 前缀,层级不一致。
现在两边同构:
amazon/sc/
AmazonScSubPlatform
dto/AmazonScShopDto, AmazonScListingDto
product/AmazonScProductSource
shop/AmazonScShopSource
amazon/vc/
AmazonVcSubPlatform
dto/AmazonVcShopDto, AmazonVcListingDto
product/AmazonVcProductSource
shop/AmazonVcShopSource
类名统一加 Sc/Vc 前缀,避免同名 DTO 混淆。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
93fc9648fe
|
feat(lingxing): 接入亚马逊 VC 店铺列表与 Listing
接口(官方文档核对):
- SHOP_LIST_AMAZON_VC /basicOpen/platformAuth/vcSeller/pageList POST, qps 1, 上限 200
- LISTING_AMAZON_VC /basicOpen/listingManage/vcListing/pageList POST, qps 1, 上限 200
实现:
- AmazonVcShopSource:自动翻页拉全部店铺,过滤 status != 1,platform_code 10035,
externalStoreId 取 vc_store_id
- AmazonVcProductSource:vc_store_ids 传数组;msku 作为 platformSku;
on_sale_time 是 Y-m-d,按市场当地时区零点解析
- AmazonVcSubPlatform 注册到 LingxingSubPlatforms
注意:VC Listing 接口无时间窗参数,只能全量翻页后由调用方比对。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
51e429b463
|
test(lingxing): 亚马逊测试类补充店铺列表,SID 可自动获取
- 新增 listsAmazonShops:调店铺列表接口,打印每个 sid 与名称
- SID 留空时自动取店铺列表第一个正常店铺,填了则直接用
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
2cb045fda9
|
test(lingxing): 亚马逊 SC 商品接口真实环境测试
- AmazonScProductLiveTest:带时间窗与不带时间窗两种拉法
- 顶部常量填 AppID / AppSecret / SID,未填时 Assumptions 跳过
- 打印脱敏请求与响应,便于核对字段映射
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
71a451f3b9
|
feat(sdk): listSubChannels 收 ChannelContext,新增 subChannels 门面与操作手册
- AggregatorCapable.listSubChannels 改为 (ChannelContext),
此前只收 ChannelAccount,拿不到端点与凭据,无法真实调店铺接口
- ChannelSdk.subChannels(key, conn):聚合器子店铺列表入口
- LingxingAdapter.listSubChannels 分派到子平台的 shopSource
- 新增《操作手册.md》:依赖、连接信息、订单/商品/店铺、增量同步、
写操作幂等、异常对照、SPI 清单
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
c1b283fbeb
|
feat(lingxing): 拆分能力 Source,接入亚马逊 SC 店铺与 Listing
结构(避免单个平台类随能力增长膨胀):
- LingxingSubPlatform 瘦成能力组合入口:orderSource / productSource / shopSource
- 新增 platform/order|product|shop 三个能力接口
- 沃尔玛订单迁到 walmart/order/WalmartOrderSource
- AmazonScSubPlatform 组合 AmazonShopSource + AmazonProductSource
- LingxingAdapter 实现 ProductCapable,按子平台分派
接口(官方文档核对):
- LingxingApi 新增 SHOP_LIST_AMAZON_SC (/erp/sc/data/seller/lists, GET, qps 1)
- LingxingApi 新增 LISTING_AMAZON_SC (/erp/sc/data/mws/listing, POST, qps 1)
- LingxingRequestFactory 增加 get(...):GET 无业务参数时 query 只带 app_key/timestamp/sign
- LingxingCall 增加 get(...) 与 execute(...)
映射要点:
- 店铺:sid 作为 externalStoreId,platform_code 10001
- Listing:seller_sku 作为 platformSku(参与 canonicalKey)
- listing_update_date 是零时区时间,按 UTC 解析
订单接口未核对,亚马逊暂不声明订单能力。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
782225fe32
|
feat(lingxing): 令牌续约接口
按官方文档 /api/auth-server/oauth/refresh 实现:
- 表单 appId + refreshToken,multipart/form-data
- 每个 refresh_token 只能使用一次,响应返回新的 refresh_token
- 成功码 "200",失败时 HTTP 仍 200,靠 code 区分
LingxingAdapter 的刷新策略:
1. previous 有 refresh_token → 走续约
2. 续约抛 AuthException → 退回 appId + appSecret 全量换新
3. previous 为空(首次/被 forceRefresh 删除)→ 全量换新
顺带清理:
- LingxingApi 新增 TOKEN_REFRESH
- 删除 LingxingAdapter 中已迁往子平台的 buildOrderListBody / signedRequest
- 删除相应未使用 import
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
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
|
89f29d7767
|
refactor(lingxing): 按职责拆分 adapter / auth / http / mapper / dto 五个包
- adapter:LingxingAdapter、LingxingAdapterFactory(入口)
- auth:LingxingTokenClient(换 token)
- http:RequestFactory / Signer / Envelope / RateLimiter(出网与响应判定)
- mapper:LingxingOrderMapper(DTO → 统一模型)
- dto:领星原始报文结构(不变)
- 根包只留 LingxingConstants
跨包使用后 RateLimiter / RequestFactory 的构造器与 post/acquire 提升为 public。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
71389aae5d
|
test(lingxing): 冒烟测试改为直接填常量,不再读环境变量
占位常量未填时用 Assumptions 跳过,不会拿占位串去打真实接口。
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
|
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 |
lml
|
703694c3df
|
fix(lingxing): 按真实响应重写订单 DTO 与字段映射
真实 /pb/mp/order/v2/list 响应与文档摘录不一致,原 DTO 字段名全部落空,
channelOrderId 为 null,导致 SalesOrder 构造抛 NPE。
- 订单字段改为 global_order_no / amount_currency / status /
item_info / platform_info / transaction_info
- 平台单号从 platform_info[] 取,合并单排序后取第一个,保证 canonicalKey 稳定
- 收货国家取 platform_info[].store_Country_code
- 下单时间取 global_purchase_time,缺失时回落 platform_info[].purchase_time
- 金额清洗币种符号与千分位(¥49.16 → 49.16)
- 夹具与映射测试按真实结构重写
|
3 weeks ago |
lml
|
2bc5da043a
|
feat(lingxing): 按 2026 版官方算法重写签名并抽出统一请求层
签名:
- 签名范围改为「业务参数 + access_token + app_key + timestamp」,按 key 升序拼接
- MD5 输出 32 位大写,再用 appId 做 AES/ECB/PKCS5Padding 加密并 Base64
- 集合参数先 JSON 序列化再参与签名
- appId 不是 16/24/32 字节时直接抛 IllegalArgumentException,不静默补齐
请求层:
- 新增 LingxingEnvelope,业务错误看 body.code,映射限流/鉴权/业务异常
- 新增 LingxingRateLimiter,按接口路径分桶,订单列表 10 req/s
- 新增 LingxingRequestFactory,access_token 只进 Authorization 但参与签名
- 订单列表请求体改为 start_time/end_time(epoch 秒)+ platform_code/store_id 数组
- 分页改为「满页 + total 兜底」,避免最后一页多发一次请求
- 令牌缓存键从 store_id 改为 appKey,同 app 多店铺共用 token
- 映射异常包装成 ValidationException 并保留原始报文,避免以 NPE 形式冒出
|
3 weeks ago |
chenchuchuan
|
8e7fbb294a
|
test(http): TokenManager 等锁超时可注入,测试从 5s 降到 50ms
生产默认仍是 50ms 轮询 / 5s 超时;新增仅测试可见的构造器,
避免 lockHeldByAnotherInstanceIsNotBrokenThrough 真等 5 秒。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
eeb0b71efa
|
feat(http): TokenManager 按设计文档 9.1 补齐五条要求
- 按 AccountKey 隔离缓存:缓存键由适配器按账户维度拼出
- 提前续期:保留原有 needsRefresh 逻辑
- LockProvider 防击穿:拿不到锁时轮询等待(50ms × 最多 5s),
期间重读缓存;对方刷成功后直接复用,超时才抛 AuthException
- 刷新失败不返回旧 token:不做宽限兜底,异常直接抛给调用方
- 日志只打指纹:沿用 AccessToken.fingerprint()
- 人工失效/重授权:forceRefresh 删缓存后重取
领星侧 tokenKey 从 externalStoreId 改为 appKey:领星 token 按 app 发放,
同 app 多店铺应共用一个 token,避免重复换 token 烧配额。
新增 TokenManagerTest,覆盖缓存、提前续期、强制刷新、失败不留旧值、
锁被占用时不重复刷新、指纹脱敏六类场景。
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
chenchuchuan
|
5bd69e7f1c
|
docs(guide): 补充端点写成常量、SDK 不碰存储不读配置两条约定
|
3 weeks ago |
chenchuchuan
|
64209629ff
|
refactor(sdk): 明确 AdapterConfig 不是配置项
SDK 的初衷是不读任何配置、不碰任何存储。原 AdapterConfig 带 endpointBaseUrl +
sandbox 两个字段,容易被误解为可配置端点;sandbox 更是与 ChannelAccount.sandbox
重复且从未被工厂使用。
- AdapterConfig 收敛为单一字段 endpointBaseUrl,仅用于测试/联调覆盖目标地址
- 新增 AdapterConfig.NONE 常量,替换 ChannelSdk 里内联的 new AdapterConfig(null, false)
- LingxingConstants 补注释:端点与路径属于协议,必须写在代码里
Co-Authored-By: Claude <noreply@anthropic.com>
|
3 weeks ago |
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 |