Files
Edu/services/msg/src/app.module.ts
SpecialX 7b7abbb309 feat(msg): 完整实现 msg 消息服务
包含 channels/preferences/templates/grpc/kafka/outbox/push/redis 等完整实现
2026-07-10 19:09:52 +08:00

44 lines
1.6 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.
import { Module } from "@nestjs/common";
import { APP_GUARD } from "@nestjs/core";
import { NotificationsModule } from "./notifications/notifications.module.js";
import { PreferencesModule } from "./preferences/preferences.module.js";
import { TemplatesModule } from "./templates/templates.module.js";
import { GrpcModule } from "./grpc/grpc.module.js";
import { HealthModule } from "./shared/health/health.module.js";
import { PermissionGuard } from "./middleware/permission.guard.js";
import { LifecycleService } from "./shared/lifecycle/lifecycle.service.js";
import { KafkaConsumerService } from "./shared/kafka/kafka.consumer.js";
/**
* AppModule —— msg 服务根模块。
*
* 仲裁依据:
* - M1gRPC 50056 启用GrpcModule 注册 3 controller 共 17 RPC
* - HTTP REST + gRPC 双协议入口,共享同一套 Service 单例
* - KafkaConsumerService 消费 12 类事件触发通知
*
* 模块依赖图:
* AppModule
* ├─ NotificationsModuleREST + Service
* ├─ PreferencesModuleREST + Service
* ├─ TemplatesModuleREST + Service
* ├─ GrpcModulegRPC controllersimports 上述 3 模块获取 Service
* ├─ HealthModule/healthz + /readyz
* └─ providers: PermissionGuard(APP_GUARD) + LifecycleService + KafkaConsumerService
*/
@Module({
imports: [
NotificationsModule,
PreferencesModule,
TemplatesModule,
GrpcModule,
HealthModule,
],
providers: [
{ provide: APP_GUARD, useClass: PermissionGuard },
LifecycleService,
KafkaConsumerService,
],
})
export class AppModule {}