|
|
@@ -3,6 +3,7 @@
|
|
|
## 版本信息
|
|
|
| 版本 | 日期 | 描述 | 作者 |
|
|
|
|------|------|------|------|
|
|
|
+| 3.4 | 2025-11-12 | 添加商品管理模块包 (@d8d/goods-module) | James |
|
|
|
| 3.3 | 2025-11-12 | 补充新添加的业务模块包(广告、商户、供应商) | Winston |
|
|
|
| 3.2 | 2025-11-11 | 更新包结构,添加基础设施和业务模块包 | Winston |
|
|
|
| 3.1 | 2025-11-09 | 更新测试结构,清理重复测试文件 | James |
|
|
|
@@ -247,6 +248,38 @@ d8d-mini-starter/
|
|
|
│ │ │ ├── user-routes.integration.test.ts # 用户路由集成测试
|
|
|
│ │ │ └── admin-routes.integration.test.ts # 管理员路由集成测试
|
|
|
│ │ └── package.json
|
|
|
+│ ├── goods-module/ # 商品管理模块 (@d8d/goods-module)
|
|
|
+│ │ ├── src/
|
|
|
+│ │ │ ├── entities/
|
|
|
+│ │ │ │ ├── goods.entity.ts # 商品实体
|
|
|
+│ │ │ │ └── goods-category.entity.ts # 商品分类实体
|
|
|
+│ │ │ ├── services/
|
|
|
+│ │ │ │ ├── goods.service.ts # 商品服务
|
|
|
+│ │ │ │ └── goods-category.service.ts # 商品分类服务
|
|
|
+│ │ │ ├── schemas/
|
|
|
+│ │ │ │ ├── goods.schema.ts # 商品Schema
|
|
|
+│ │ │ │ ├── goods-category.schema.ts # 商品分类Schema
|
|
|
+│ │ │ │ ├── random.schema.ts # 随机商品Schema
|
|
|
+│ │ │ │ ├── user-goods.schema.ts # 用户专用Schema
|
|
|
+│ │ │ │ ├── admin-goods.schema.ts # 管理员专用Schema
|
|
|
+│ │ │ │ └── public-goods.schema.ts # 公开商品Schema
|
|
|
+│ │ │ ├── types/
|
|
|
+│ │ │ │ └── goods.types.ts # 商品类型定义
|
|
|
+│ │ │ └── routes/
|
|
|
+│ │ │ ├── admin-goods-categories.ts # 商品分类管理路由
|
|
|
+│ │ │ ├── public-goods-random.ts # 公开随机商品路由
|
|
|
+│ │ │ ├── user-goods-routes.ts # 用户路由
|
|
|
+│ │ │ ├── admin-goods-routes.ts # 管理员路由
|
|
|
+│ │ │ ├── public-goods-routes.ts # 公开商品路由
|
|
|
+│ │ │ └── index.ts # 路由导出
|
|
|
+│ │ ├── tests/
|
|
|
+│ │ │ └── integration/
|
|
|
+│ │ │ ├── admin-goods-categories.integration.test.ts # 商品分类集成测试
|
|
|
+│ │ │ ├── public-goods-random.integration.test.ts # 随机商品集成测试
|
|
|
+│ │ │ ├── user-goods-routes.integration.test.ts # 用户路由集成测试
|
|
|
+│ │ │ ├── admin-goods-routes.integration.test.ts # 管理员路由集成测试
|
|
|
+│ │ │ └── public-goods-routes.integration.test.ts # 公开商品路由集成测试
|
|
|
+│ │ └── package.json
|
|
|
│ └── geo-areas/ # 地区模块 (@d8d/geo-areas)
|
|
|
│ ├── src/
|
|
|
│ │ ├── modules/areas/
|
|
|
@@ -330,7 +363,7 @@ d8d-mini-starter/
|
|
|
- **包架构层次**:
|
|
|
- **基础设施层**: shared-types → shared-utils → shared-crud
|
|
|
- **测试基础设施**: shared-test-util
|
|
|
- - **业务模块层**: user-module → auth-module → file-module → delivery-address-module → advertisements-module → merchant-module → supplier-module → geo-areas
|
|
|
+ - **业务模块层**: user-module → auth-module → file-module → delivery-address-module → advertisements-module → merchant-module → supplier-module → goods-module → geo-areas
|
|
|
- **应用层**: server (重构后)
|
|
|
- **测试结构**:
|
|
|
- **基础设施包**: 每个包独立的单元测试和集成测试
|