Files
whale-town-end/src/gateway/auth/auth.gateway.module.ts
moyin 5bc7cdb532 fix(auth): 修复AuthGatewayModule依赖注入问题
范围: src/gateway/auth/
- 在AuthGatewayModule中导入LoginCoreModule
- 解决JwtAuthGuard无法注入LoginCoreService的问题
- 确保依赖注入链的完整性
2026-01-14 14:21:35 +08:00

56 lines
1.3 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.
/**
* 认证网关模块
*
* 架构层级Gateway Layer网关层
*
* 功能描述:
* - 整合所有认证相关的网关组件
* - 提供HTTP API接口
* - 配置认证守卫和中间件
* - 处理请求验证和响应格式化
*
* 职责分离:
* - 专注于HTTP协议处理和API网关功能
* - 依赖业务层服务,不包含业务逻辑
* - 提供统一的API入口和文档
*
* 依赖关系:
* - 依赖 Business Layer 的 AuthModule
* - 提供 Controller 和 Guard
*
* @author moyin
* @version 2.0.0
* @since 2026-01-14
* @lastModified 2026-01-14
*/
import { Module } from '@nestjs/common';
import { LoginController } from './login.controller';
import { RegisterController } from './register.controller';
import { JwtAuthGuard } from './jwt_auth.guard';
import { AuthModule } from '../../business/auth/auth.module';
import { LoginCoreModule } from '../../core/login_core/login_core.module';
@Module({
imports: [
// 导入业务层模块
AuthModule,
// 导入核心层模块JwtAuthGuard需要LoginCoreService
LoginCoreModule,
],
controllers: [
// 网关层控制器
LoginController,
RegisterController,
],
providers: [
// 认证守卫
JwtAuthGuard,
],
exports: [
// 导出守卫供其他模块使用
JwtAuthGuard,
],
})
export class AuthGatewayModule {}