refactor(auth): 重构认证模块架构 - 将Gateway层组件从Business层分离

范围:src/gateway/auth/, src/business/auth/, src/app.module.ts
涉及文件:
- 新增:src/gateway/auth/ 目录及所有文件
- 移动:Controller、Guard、Decorator、DTO从business层移至gateway层
- 修改:src/business/auth/index.ts(移除Gateway层组件导出)
- 修改:src/app.module.ts(使用AuthGatewayModule替代AuthModule)

主要改进:
- 明确Gateway层和Business层的职责边界
- Controller、Guard、Decorator属于Gateway层职责
- Business层专注于业务逻辑和服务
- 符合分层架构设计原则
This commit is contained in:
moyin
2026-01-14 13:07:11 +08:00
parent f7c3983cc1
commit 73e3e0153c
21 changed files with 565 additions and 220 deletions

View File

@@ -2,38 +2,30 @@
* 用户认证业务模块导出
*
* 功能概述:
* - 用户登录和注册
* - 用户登录和注册业务逻辑
* - GitHub OAuth集成
* - 密码管理(忘记密码、重置密码、修改密码)
* - 邮箱验证功能
* - JWT Token管理
*
* 职责分离:
* - 专注于模块导出和接口暴露
* - 提供统一的模块入口点
* - 专注于业务层模块导出
* - 提供统一的业务服务入口点
* - 简化外部模块的引用方式
*
* 最近修改:
* - 2026-01-14: 架构重构 - 移除Controller和DTO导出已移至Gateway层(修改者: moyin)
* - 2026-01-07: 代码规范优化 - 文件夹扁平化,移除单文件文件夹结构
* - 2026-01-07: 代码规范优化 - 更新注释规范
*
* @author moyin
* @version 1.0.2
* @version 2.0.0
* @since 2025-12-17
* @lastModified 2026-01-07
* @lastModified 2026-01-14
*/
// 模块
export * from './auth.module';
// 控制器
export * from './login.controller';
export * from './register.controller';
// 服务
// 服务(业务层)
export { LoginService } from './login.service';
export { RegisterService } from './register.service';
// DTO
export * from './login.dto';
export * from './login_response.dto';
export { RegisterService } from './register.service';