|
|
@@ -52,14 +52,14 @@ Draft
|
|
|
- [x] 编写基础测试
|
|
|
|
|
|
### 第二阶段:业务模块包
|
|
|
-- [ ] 创建 user-module package (AC: 4)
|
|
|
- - [ ] 创建 package.json 配置
|
|
|
- - [ ] 迁移用户实体类(UserEntity、Role)
|
|
|
- - [ ] 迁移用户服务类(UserService、RoleService)
|
|
|
- - [ ] 迁移用户相关 Schema 定义
|
|
|
- - [ ] 迁移用户 API 路由
|
|
|
- - [ ] 配置 TypeScript 编译选项(包含 `"composite": true`)
|
|
|
- - [ ] 编写单元测试和集成测试
|
|
|
+- [x] 创建 user-module package (AC: 4)
|
|
|
+ - [x] 创建 package.json 配置
|
|
|
+ - [x] 迁移用户实体类(UserEntity、Role)
|
|
|
+ - [x] 迁移用户服务类(UserService、RoleService)
|
|
|
+ - [x] 迁移用户相关 Schema 定义
|
|
|
+ - [x] 迁移用户 API 路由
|
|
|
+ - [x] 配置 TypeScript 编译选项(包含 `"composite": true`)
|
|
|
+ - [x] 编写单元测试和集成测试
|
|
|
|
|
|
- [ ] 创建 auth-module package (AC: 5)
|
|
|
- [ ] 创建 package.json 配置
|
|
|
@@ -300,6 +300,7 @@ Draft
|
|
|
| 2025-11-10 | 1.1 | 基于实际代码依赖分析调整任务顺序和依赖关系 | Bob (Scrum Master) |
|
|
|
| 2025-11-10 | 2.0 | **重大架构调整**:从功能分包改为模块分包架构,按照 users/auth/files 模块组织 | Bob (Scrum Master) |
|
|
|
| 2025-11-10 | 2.1 | **shared-crud 包完成**:通用 CRUD 服务模式、路由模式和测试全部完成 | Claude Code |
|
|
|
+| 2025-11-10 | 2.2 | **user-module 包完成**:用户管理模块(实体、服务、路由、测试)全部完成 | Claude Code |
|
|
|
|
|
|
## Dev Agent Record
|
|
|
*此部分由开发代理在实现过程中填写*
|
|
|
@@ -328,6 +329,15 @@ Claude Sonnet 4.5 (claude-sonnet-4-5-20250929)
|
|
|
- ✅ 单元测试编写完成并通过(23/23 测试)
|
|
|
- ✅ 依赖版本与 packages/server 保持一致
|
|
|
- ✅ 修复了 AppDataSource 在测试环境中的初始化问题
|
|
|
+- ✅ user-module package 创建完成
|
|
|
+- ✅ 用户实体类已迁移(UserEntity、Role)
|
|
|
+- ✅ 用户服务类已迁移(UserService、RoleService)
|
|
|
+- ✅ 用户相关 Schema 定义已迁移
|
|
|
+- ✅ 用户 API 路由已迁移
|
|
|
+- ✅ TypeScript 配置完成(包含 composite: true)
|
|
|
+- ✅ 单元测试和集成测试编写完成并通过(41/41 测试)
|
|
|
+- ✅ 依赖版本与 packages/server 保持一致
|
|
|
+- ✅ 修复了测试文件中的类型转换问题
|
|
|
|
|
|
### File List
|
|
|
**新增文件:**
|
|
|
@@ -359,7 +369,31 @@ Claude Sonnet 4.5 (claude-sonnet-4-5-20250929)
|
|
|
- `packages/shared-types/src/index.ts` - 添加 JWTPayload 类型定义
|
|
|
- `tsconfig.json` - 创建根目录 TypeScript 配置
|
|
|
|
|
|
+**新增文件:**
|
|
|
+- `packages/user-module/package.json` - 包配置
|
|
|
+- `packages/user-module/tsconfig.json` - TypeScript 配置
|
|
|
+- `packages/user-module/vitest.config.ts` - 测试配置
|
|
|
+- `packages/user-module/src/index.ts` - 包入口
|
|
|
+- `packages/user-module/src/entities/index.ts` - 实体导出
|
|
|
+- `packages/user-module/src/entities/user.entity.ts` - 用户实体
|
|
|
+- `packages/user-module/src/entities/role.entity.ts` - 角色实体
|
|
|
+- `packages/user-module/src/services/index.ts` - 服务导出
|
|
|
+- `packages/user-module/src/services/user.service.ts` - 用户服务
|
|
|
+- `packages/user-module/src/services/role.service.ts` - 角色服务
|
|
|
+- `packages/user-module/src/schemas/index.ts` - Schema 导出
|
|
|
+- `packages/user-module/src/schemas/user.schema.ts` - 用户 Schema
|
|
|
+- `packages/user-module/src/schemas/role.schema.ts` - 角色 Schema
|
|
|
+- `packages/user-module/src/routes/index.ts` - 路由导出
|
|
|
+- `packages/user-module/src/routes/user.routes.ts` - 用户路由
|
|
|
+- `packages/user-module/src/routes/role.routes.ts` - 角色路由
|
|
|
+- `packages/user-module/src/routes/custom.routes.ts` - 自定义路由
|
|
|
+- `packages/user-module/tests/unit/user.service.test.ts` - 用户服务单元测试
|
|
|
+- `packages/user-module/tests/unit/role.service.test.ts` - 角色服务单元测试
|
|
|
+- `packages/user-module/tests/integration/user.integration.test.ts` - 用户集成测试
|
|
|
+- `packages/user-module/tests/integration/role.integration.test.ts` - 角色集成测试
|
|
|
+
|
|
|
**依赖关系:**
|
|
|
- shared-utils 依赖 shared-types
|
|
|
- shared-crud 依赖 shared-types 和 shared-utils
|
|
|
+- user-module 依赖 shared-types、shared-utils 和 shared-crud
|
|
|
- 所有外部依赖版本与 packages/server 完全一致
|