/** * 安全功能模块 * * 功能描述: * - 整合所有安全相关功能 * - 频率限制和请求超时控制 * - 维护模式和内容类型验证 * - 系统安全防护机制 * * @author kiro-ai * @version 1.0.0 * @since 2025-12-24 */ import { Module } from '@nestjs/common'; import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'; import { ThrottleGuard } from './guards/throttle.guard'; import { TimeoutInterceptor } from './interceptors/timeout.interceptor'; @Module({ providers: [ ThrottleGuard, TimeoutInterceptor, // 全局频率限制守卫 { provide: APP_GUARD, useClass: ThrottleGuard, }, // 全局超时拦截器 { provide: APP_INTERCEPTOR, useClass: TimeoutInterceptor, }, ], exports: [ThrottleGuard, TimeoutInterceptor], }) export class SecurityModule {}