Files
whale-town-end/src/business/auth/auth.module.ts
moyin d92a078fc7 refactor:将 ZulipAccountsModule 改为全局单例模块
- 在 AppModule 中统一导入 ZulipAccountsModule.forRoot()
- 移除 admin.module、auth.module、zulip.module 中的重复导入
- 添加数据库 charset: utf8mb4 配置,支持中文和 emoji
2026-01-15 14:58:28 +08:00

60 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 用户认证业务模块
*
* 架构层级Business Layer业务层
*
* 功能描述:
* - 整合所有用户认证相关的业务逻辑
* - 用户登录、注册、密码管理业务流程
* - GitHub OAuth业务集成
* - 邮箱验证业务功能
* - Zulip账号关联业务
*
* 职责分离:
* - 专注于业务逻辑实现和流程控制
* - 整合核心服务完成业务功能
* - 不包含HTTP协议处理由Gateway层负责
* - 不包含数据访问细节由Core层负责
*
* 依赖关系:
* - 依赖 Core Layer 的 LoginCoreModule
* - 依赖 Core Layer 的 ZulipCoreModule
* - 被 Gateway Layer 的 AuthGatewayModule 使用
*
* 最近修改:
* - 2026-01-14: 架构重构 - 移除Controller专注于业务逻辑层
* - 2026-01-07: 代码规范优化 - 文件夹扁平化,移除单文件文件夹结构
*
* @author moyin
* @version 2.0.0
* @since 2025-12-24
* @lastModified 2026-01-14
*/
import { Module } from '@nestjs/common';
import { LoginService } from './login.service';
import { RegisterService } from './register.service';
import { LoginCoreModule } from '../../core/login_core/login_core.module';
import { ZulipCoreModule } from '../../core/zulip_core/zulip_core.module';
import { UsersModule } from '../../core/db/users/users.module';
@Module({
imports: [
// 导入核心层模块
LoginCoreModule,
ZulipCoreModule,
// 注意ZulipAccountsModule 是全局模块,已在 AppModule 中导入,无需重复导入
UsersModule,
],
providers: [
// 业务服务
LoginService,
RegisterService,
],
exports: [
// 导出业务服务供Gateway层使用
LoginService,
RegisterService,
],
})
export class AuthModule {}