diff --git a/GUIDE.md b/GUIDE.md index f1da7cc..9914565 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -569,7 +569,7 @@ TokenManager tm = new TokenManager(tokenStore, lockProvider, clock, 600) { 防击穿、提前续期、日志只打指纹,模板都写好了。 -**要签名的**,实现 `Signer` 或写静态工具类: +**要签名的**,写静态工具类: ```java public final class AcmeSigner { diff --git a/README.md b/README.md index 69fa6c7..6121675 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ① 统一入口 ChannelSdk / 各能力视图(SalesOrders / Products / Outbounds / AfterSales / Settlements) ② 能力接口 ProductCapable / SalesOrderCapable / ShippingLabelCapable / AfterSaleCapable / ... ③ 平台适配 lingxing(聚合:amazon-sc / walmart / tiktok / temu / ebay / shein / target …) -④ 基础设施 HttpTransport / Signer / TokenManager / LingxingRateLimiter / SyncEngine / Idempotency +④ 基础设施 HttpTransport / TokenManager / LingxingRateLimiter / SyncEngine / Idempotency ⑤ 宿主 SPI AccountRepository / TokenStore / SyncCursorStore / Sink / Clock / LockProvider / ... ``` @@ -32,7 +32,7 @@ graph TD CMODEL["channel · 领域模型
SalesOrder · ProductListing · AccountKey · Page"] ENGINE["channel · 同步管道
SyncEngine"] SHARED["shared · 跨域共享层
异常 · 幂等 · 审计 · 枚举 · SPI 定义 · Money/Page"] - HTTPM["http · 出入网层
HttpTransport · Signer · TokenManager · JsonCodec"] + HTTPM["http · 出入网层
HttpTransport · TokenManager · JsonCodec"] LX["lingxing · 聚合适配器
LingxingAdapter → LingxingSubPlatforms → 子平台 Source"] end @@ -187,7 +187,7 @@ common.ecommerce │ ├── http HTTP 与令牌(http) │ HttpTransport / OkHttpTransport / HttpRequest / HttpResponse / -│ JsonCodec / JacksonJsonCodec / Signer / TokenManager / Responses +│ JsonCodec / JacksonJsonCodec / TokenManager / Responses │ └── lingxing 领星聚合适配器(lingxing) ├── LingxingApi 接口定义(路径 + 限流参数) @@ -401,7 +401,6 @@ common.ecommerce | `HttpTransport` | 传输接口,默认 `OkHttpTransport`(连接 5s / 读 30s) | | `HttpRequest` / `HttpResponse` | 统一请求响应,保留原始 header/body 供留痕 | | `JsonCodec` | JSON 抽象,`JacksonJsonCodec` 提供点路径取值 `nodeAt("data.list")` | -| `Signer` | 签名接口,各平台实现 | | `TokenManager` | 令牌模板:账户隔离、提前续期、`LockProvider` 防击穿、日志只打指纹 | | `Responses` | 状态码 → 异常映射(`throwIfNotSuccess`) | @@ -710,7 +709,7 @@ public final class AmazonScAdapter implements SalesOrderCapable, FulfillmentCapa } ``` -**第 3 步:写签名器**,实现 `Signer`(LWA 只需 `Authorization: Bearer`,签名器可为空实现)。 +**第 3 步:写签名器**,静态工具类即可(如 `LingxingSigner`)——签名参数往往要在构造 `HttpRequest` 之前算,没有统一接口。LWA 只需 `Authorization: Bearer`,连签名器都不用。 **第 4 步:写报文映射**,平台 JSON → 统一模型。**平台字段名只出现在 DTO 和 Mapper 里**。 diff --git a/http/src/main/java/common/ecommerce/http/Signer.java b/http/src/main/java/common/ecommerce/http/Signer.java deleted file mode 100644 index 83f3f44..0000000 --- a/http/src/main/java/common/ecommerce/http/Signer.java +++ /dev/null @@ -1,10 +0,0 @@ -package common.ecommerce.http; - -/** - * 签名器。按平台实现,差异收敛在适配器内。 - */ -public interface Signer { - - /** 在请求上补齐签名相关的 header / query。 */ - HttpRequest sign(HttpRequest request, common.ecommerce.shared.spi.ChannelSecret secret); -}