feat(msg): 完整实现 msg 消息服务
包含 channels/preferences/templates/grpc/kafka/outbox/push/redis 等完整实现
This commit is contained in:
@@ -1,15 +1,43 @@
|
||||
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 服务根模块。
|
||||
*
|
||||
* 仲裁依据:
|
||||
* - M1:gRPC 50056 启用(GrpcModule 注册 3 controller 共 17 RPC)
|
||||
* - HTTP REST + gRPC 双协议入口,共享同一套 Service 单例
|
||||
* - KafkaConsumerService 消费 12 类事件触发通知
|
||||
*
|
||||
* 模块依赖图:
|
||||
* AppModule
|
||||
* ├─ NotificationsModule(REST + Service)
|
||||
* ├─ PreferencesModule(REST + Service)
|
||||
* ├─ TemplatesModule(REST + Service)
|
||||
* ├─ GrpcModule(gRPC controllers,imports 上述 3 模块获取 Service)
|
||||
* ├─ HealthModule(/healthz + /readyz)
|
||||
* └─ providers: PermissionGuard(APP_GUARD) + LifecycleService + KafkaConsumerService
|
||||
*/
|
||||
@Module({
|
||||
imports: [NotificationsModule, HealthModule],
|
||||
imports: [
|
||||
NotificationsModule,
|
||||
PreferencesModule,
|
||||
TemplatesModule,
|
||||
GrpcModule,
|
||||
HealthModule,
|
||||
],
|
||||
providers: [
|
||||
{ provide: APP_GUARD, useClass: PermissionGuard },
|
||||
LifecycleService,
|
||||
KafkaConsumerService,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user