Browse Source

chore: 初始化 common-ecommerce 多模块骨架

四个模块:core / http / testkit / lingxing。
JDK 1.8 编译,依赖版本在 parent 统一管理,
core 仅依赖 slf4j-api,保证无第三方运行时耦合。

Co-Authored-By: Claude <noreply@anthropic.com>
master
chenchuchuan 21 hours ago
commit
3b8c99d9b1
  1. 18
      .gitignore
  2. 39
      README.md
  3. 27
      core/pom.xml
  4. 48
      http/pom.xml
  5. 45
      lingxing/pom.xml
  6. 97
      pom.xml
  7. 34
      testkit/pom.xml

18
.gitignore vendored

@ -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

39
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`。

27
core/pom.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>apelet</groupId>
<artifactId>common-ecommerce</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>common-ecommerce-core</artifactId>
<description>领域模型、能力接口、门面、管道、SPI(无平台代码、无第三方运行时依赖)</description>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

48
http/pom.xml

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>apelet</groupId>
<artifactId>common-ecommerce</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>common-ecommerce-http</artifactId>
<description>HTTP 传输、签名、令牌管理、JSON 编解码</description>
<dependencies>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-core</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

45
lingxing/pom.xml

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>apelet</groupId>
<artifactId>common-ecommerce</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>common-ecommerce-lingxing</artifactId>
<description>领星 Lingxing 聚合适配器(多子平台)</description>
<dependencies>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-core</artifactId>
</dependency>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-http</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-testkit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

97
pom.xml

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>apelet</groupId>
<artifactId>common-ecommerce</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>common-ecommerce</name>
<description>多渠道电商履约对接 SDK</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<okhttp.version>4.12.0</okhttp.version>
<jackson.version>2.13.5</jackson.version>
<slf4j.version>1.7.36</slf4j.version>
<junit.version>5.8.2</junit.version>
</properties>
<modules>
<module>core</module>
<module>http</module>
<module>testkit</module>
<module>lingxing</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-testkit</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

34
testkit/pom.xml

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>apelet</groupId>
<artifactId>common-ecommerce</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>common-ecommerce-testkit</artifactId>
<description>测试口子:InMemory SPI、FakeTransport、夹具加载、断言工具</description>
<dependencies>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-core</artifactId>
</dependency>
<dependency>
<groupId>apelet</groupId>
<artifactId>common-ecommerce-http</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
</dependencies>
</project>
Loading…
Cancel
Save