commit 3b8c99d9b1780f0b4c0b70645fb7948ec4ada0d0 Author: chenchuchuan <13554600537@163.com> Date: Thu Oct 29 14:46:38 2026 +0800 chore: 初始化 common-ecommerce 多模块骨架 四个模块:core / http / testkit / lingxing。 JDK 1.8 编译,依赖版本在 parent 统一管理, core 仅依赖 slf4j-api,保证无第三方运行时耦合。 Co-Authored-By: Claude diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b7ae38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +target/ +*.class +*.jar +!.mvn/wrapper/maven-wrapper.jar + +.idea/ +*.iml +*.ipr +*.iws +.vscode/ +.classpath +.project +.settings/ + +*.log +logs/ +.DS_Store +Thumbs.db diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7764e2 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# common-ecommerce + +多渠道电商履约对接 SDK。把亚马逊、沃尔玛、TikTok、Temu、领星聚合等渠道的商品、订单、履约、标发、面单、账单、售后统一成一套 API。 + +## 定位 + +纯 SDK 库,嵌入宿主(OMS)进程运行。**不访问数据库、不访问 Redis、不访问 MQ、不私起线程或定时器**。所有外部副作用通过 SPI 注入,由宿主实现。 + +``` +① 统一入口 ChannelSdk / 各能力门面 +② 能力接口 ProductCapable / SalesOrderCapable / FulfillmentCapable / ... +③ 平台适配 amazon-sc / walmart-sc / tiktok / temu / lingxing / ... +④ 基础设施 HttpTransport / Signer / TokenManager / RateLimiter / SyncEngine / Idempotency +⑤ 宿主 SPI AccountRepository / TokenStore / SyncCursorStore / Sink / Clock / LockProvider / ... +``` + +## 模块 + +| 模块 | 职责 | +|:---|:---| +| `common-ecommerce-core` | 领域模型、能力接口、门面、管道、SPI。**零第三方运行时依赖** | +| `common-ecommerce-http` | HTTP 传输、签名、令牌管理、JSON 编解码 | +| `common-ecommerce-testkit` | InMemory SPI、FakeTransport、夹具加载、断言工具 | +| `common-ecommerce-lingxing` | 领星聚合适配器(多子平台) | + +## 构建 + +```bash +mvn clean test +``` + +要求 JDK 1.8、Maven 3.6+。 + +## 设计文档 + +- `docs/01-architecture.md` 总体设计与边界 +- `docs/02-testing.md` 测试分层与夹具约定 + +完整规格见 OMS 侧 `cross-border-fulfillment-sdk-design.md`。 diff --git a/core/pom.xml b/core/pom.xml new file mode 100644 index 0000000..2f10f2f --- /dev/null +++ b/core/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + + apelet + common-ecommerce + 1.0.0-SNAPSHOT + + + common-ecommerce-core + 领域模型、能力接口、门面、管道、SPI(无平台代码、无第三方运行时依赖) + + + + org.slf4j + slf4j-api + + + org.junit.jupiter + junit-jupiter + test + + + diff --git a/http/pom.xml b/http/pom.xml new file mode 100644 index 0000000..b6f810c --- /dev/null +++ b/http/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + apelet + common-ecommerce + 1.0.0-SNAPSHOT + + + common-ecommerce-http + HTTP 传输、签名、令牌管理、JSON 编解码 + + + + apelet + common-ecommerce-core + + + com.squareup.okhttp3 + okhttp + + + com.fasterxml.jackson.core + jackson-databind + + + org.slf4j + slf4j-api + + + org.junit.jupiter + junit-jupiter + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + diff --git a/lingxing/pom.xml b/lingxing/pom.xml new file mode 100644 index 0000000..f90e38c --- /dev/null +++ b/lingxing/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + apelet + common-ecommerce + 1.0.0-SNAPSHOT + + + common-ecommerce-lingxing + 领星 Lingxing 聚合适配器(多子平台) + + + + apelet + common-ecommerce-core + + + apelet + common-ecommerce-http + + + com.fasterxml.jackson.core + jackson-databind + + + org.slf4j + slf4j-api + + + + apelet + common-ecommerce-testkit + test + + + org.junit.jupiter + junit-jupiter + test + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f17fa7e --- /dev/null +++ b/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + apelet + common-ecommerce + 1.0.0-SNAPSHOT + pom + common-ecommerce + 多渠道电商履约对接 SDK + + + UTF-8 + UTF-8 + 1.8 + 1.8 + 1.8 + + 4.12.0 + 2.13.5 + 1.7.36 + 5.8.2 + + + + core + http + testkit + lingxing + + + + + + apelet + common-ecommerce-core + ${project.version} + + + apelet + common-ecommerce-http + ${project.version} + + + apelet + common-ecommerce-testkit + ${project.version} + + + + com.squareup.okhttp3 + okhttp + ${okhttp.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.junit.jupiter + junit-jupiter + ${junit.version} + test + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 1.8 + 1.8 + UTF-8 + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + + + diff --git a/testkit/pom.xml b/testkit/pom.xml new file mode 100644 index 0000000..96566c8 --- /dev/null +++ b/testkit/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + + apelet + common-ecommerce + 1.0.0-SNAPSHOT + + + common-ecommerce-testkit + 测试口子:InMemory SPI、FakeTransport、夹具加载、断言工具 + + + + apelet + common-ecommerce-core + + + apelet + common-ecommerce-http + + + com.fasterxml.jackson.core + jackson-databind + + + org.junit.jupiter + junit-jupiter + + +