Commit Graph

66 Commits

Author SHA1 Message Date
moyin
47a738067a feat: 重构业务模块架构
- 新增auth模块处理认证逻辑
- 新增security模块处理安全相关功能
- 新增user-mgmt模块管理用户相关操作
- 新增shared模块存放共享组件
- 重构admin模块,添加DTO和Guards
- 为admin模块添加测试文件结构
2025-12-24 18:04:30 +08:00
angjustinl
9b35a1c500 feat(login): Add verification code login functionality
- Add verification code login endpoint to support passwordless authentication via email or phone
- Add send login verification code endpoint to initiate verification code delivery
- Implement verificationCodeLogin method in LoginService to handle verification code authentication
- Implement sendLoginVerificationCode method in LoginService to send verification codes to users
- Add VerificationCodeLoginRequest and related DTOs to support new login flow
- Add VerificationCodeLoginDto and SendLoginVerificationCodeDto for API request validation
- Implement verificationCodeLogin and sendLoginVerificationCode in LoginCoreService
- Add comprehensive Swagger documentation for new endpoints with proper status codes and responses
- Support test mode for verification code delivery with 206 Partial Content status
- Fix UsersService dependency injection in test specifications to use string token
- Enhance authentication options by providing passwordless login alternative to traditional password-based authentication
2025-12-19 23:22:40 +08:00
jianuo
43c9cbc863 test:添加管理后台的单元测试 2025-12-19 23:18:57 +08:00
jianuo
a4a3a60db7 feat:添加日志功能 2025-12-19 20:01:45 +08:00
jianuo
dd4fb6edd3 feat:简单添加管理员后台功能 2025-12-19 19:17:47 +08:00
angjustinl
26ea5ac815 feat(sql, auth, email, dto):重构邮箱验证流程,引入基于内存的用户服务,并改进 API 响应处理
* 新增完整的 API 状态码文档,并对测试模式进行特殊处理(`206 Partial Content`)
* 重组 DTO 结构,引入 `app.dto.ts` 与 `error_response.dto.ts`,以实现统一、规范的响应格式
* 重构登录相关 DTO,优化命名与结构,提升可维护性
* 实现基于内存的用户服务(`users_memory.service.ts`),用于开发与测试环境
* 更新邮件服务,增强验证码生成逻辑,并支持测试模式自动识别
* 增强登录控制器与服务层的错误处理能力,统一响应行为
* 优化核心登录服务,强化参数校验并集成邮箱验证流程
* 新增 `@types/express` 依赖,提升 TypeScript 类型支持与开发体验
* 改进 `main.ts`,优化应用初始化流程与配置管理
* 在所有服务中统一错误处理机制,采用标准化的错误响应格式
* 实现测试模式(`206`)与生产环境邮件发送(`200`)之间的无缝切换
2025-12-18 00:17:43 +08:00
moyin
34a9e727b4 feat:添加验证码调试功能
- 在验证码服务中添加debugCodeInfo方法
- 在业务层添加debugVerificationCode调试接口
- 新增/auth/debug-verification-code调试端点
- 支持查看验证码详细状态信息(TTL、尝试次数等)
- 便于开发和生产环境问题排查
2025-12-17 21:23:22 +08:00
moyin
c2ddb67b3e service:更新登录业务服务支持邮箱验证
- 添加发送邮箱验证码服务方法
- 添加验证邮箱验证码服务方法
- 添加重新发送邮箱验证码服务方法
- 集成验证码服务和邮件服务
- 更新相关的单元测试
2025-12-17 20:22:10 +08:00
moyin
5b07535002 api:更新注册接口支持邮箱验证码
- 注册接口传递邮箱验证码参数到服务层
- 更新 API 文档描述,说明验证码使用流程
- 添加发送邮箱验证码接口
- 添加验证邮箱验证码接口
- 添加重新发送邮箱验证码接口
2025-12-17 20:07:11 +08:00
moyin
94ba3077aa dto:为注册接口添加邮箱验证码参数
- 在 RegisterDto 中添加 email_verification_code 可选字段
- 更新 RegisterRequest 接口定义
- 在注册核心服务中添加验证码验证逻辑
- 提供邮箱时必须提供有效的验证码进行验证
2025-12-17 20:06:56 +08:00
moyin
d28100e103 api:为登录控制器添加完整的Swagger文档
- 添加ApiTags、ApiOperation等装饰器
- 配置详细的请求和响应文档
- 提供HTTP状态码和错误处理说明
2025-12-17 15:16:10 +08:00
moyin
0692aaadcc dto:创建API响应数据传输对象
- 创建LoginResponseDto、RegisterResponseDto等响应DTO
- 定义标准化的API响应格式
- 添加完整的Swagger类型定义
2025-12-17 15:15:53 +08:00
moyin
76f5fa99a6 dto:为登录相关DTO添加Swagger文档注解
- 为LoginDto、RegisterDto等添加ApiProperty装饰器
- 完善字段描述、示例值和验证规则说明
- 提供详细的API参数文档
2025-12-17 15:15:35 +08:00
moyin
e350d117d3 feat:实现用户认证系统
- 添加用户登录、注册、密码重置功能
- 支持用户名/邮箱/手机号多种登录方式
- 集成GitHub OAuth第三方登录
- 实现bcrypt密码加密存储
- 添加基于角色的权限控制
- 包含完整的数据验证和错误处理
2025-12-17 14:39:45 +08:00
moyin
8591f23505 chore:清理空的gitkeep文件和临时文件
- 删除不再需要的.gitkeep占位文件
- 清理开发过程中的临时测试文件
2025-12-17 11:03:40 +08:00
moyin
7ebc75e678 chore:优化项目目录结构
- 清理不必要的 .gitkeep 占位文件
- 保留必要目录的 .gitkeep 文件
- 统一项目文件组织结构
2025-12-13 16:20:13 +08:00