forked from wangziqi/gongxue-base
feat: add NotificationsService with SSE subject pool
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
||||
import {
|
||||
@@ -28,7 +29,9 @@ import {
|
||||
DingAttendanceRaw,
|
||||
SyncLog,
|
||||
SyncState,
|
||||
} from './entities';
|
||||
ExpenseType,
|
||||
Notification,
|
||||
} from './entities';
|
||||
import { AuthModule } from './auth/auth.module';
|
||||
import { RbacModule } from './rbac/rbac.module';
|
||||
import { StudentsModule } from './students/students.module';
|
||||
@@ -48,6 +51,8 @@ import { AttendanceModule } from './attendance/attendance.module';
|
||||
import { SchedulesModule } from './schedules/schedules.module';
|
||||
import { ClassroomRentalsModule } from './classroom-rentals/classroom-rentals.module';
|
||||
import { SyncModule } from './sync/sync.module';
|
||||
import { NotificationsModule } from './notifications/notifications.module';
|
||||
import { ExpenseTypesModule } from './expense-types/expense-types.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -58,6 +63,7 @@ import { SyncModule } from './sync/sync.module';
|
||||
limit: 100, // 普通接口每分钟100次
|
||||
},
|
||||
]),
|
||||
EventEmitterModule.forRoot(),
|
||||
TypeOrmModule.forRootAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
@@ -88,7 +94,9 @@ import { SyncModule } from './sync/sync.module';
|
||||
DingAttendanceRaw,
|
||||
SyncLog,
|
||||
SyncState,
|
||||
];
|
||||
ExpenseType,
|
||||
Notification,
|
||||
];
|
||||
if (dbType === 'mysql') {
|
||||
return {
|
||||
type: 'mysql' as const,
|
||||
@@ -127,6 +135,8 @@ import { SyncModule } from './sync/sync.module';
|
||||
SchedulesModule,
|
||||
ClassroomRentalsModule,
|
||||
SyncModule,
|
||||
ExpenseTypesModule,
|
||||
NotificationsModule,
|
||||
],
|
||||
providers: [
|
||||
{ provide: APP_GUARD, useClass: ThrottlerGuard },
|
||||
|
||||
Reference in New Issue
Block a user