refactor(server): remove Department/UserDepartment entities, CampusScope, and departmentId from all entities
- Delete department.entity.ts, user-department.entity.ts - Remove Department/UserDepartment from entities/index.ts - Remove departmentId column from 18 entities (AttendanceRecord, ArchiveAttachment, Bill, ClassSchedule, Classroom, ClassroomRental, Deposit, DepositInstallment, ExamScore, LearningRecord, Occupancy, PersonalExpense, ResultArchive, Room, RoomExpense, Student, StudentEnrollment, StudentProfile, StudentReport) - Remove departments/ module entirely - Delete campus-scope.ts, campus-scope.middleware.ts (request-utils.ts kept — it's just IP extraction) - Simplify common.module.ts to empty module - Remove CampusScopeMiddleware from app.module.ts - Remove all CampusScope injections and filter calls across all services - Remove departmentId from all DTOs and controllers - Simplify dingtalk/wecom sync to only sync users (no dept table) - Update seed module to remove department seeding - Clean frontend compilation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Module, NestModule, MiddlewareConsumer } from '@nestjs/common';
|
||||
import { Module } from '@nestjs/common';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { EventEmitterModule } from '@nestjs/event-emitter';
|
||||
@@ -32,8 +32,6 @@ import {
|
||||
SyncLog,
|
||||
SyncState,
|
||||
Notification,
|
||||
Department,
|
||||
UserDepartment,
|
||||
StudentProfile,
|
||||
StudentEnrollment,
|
||||
ExamScore,
|
||||
@@ -63,7 +61,6 @@ 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 { DepartmentsModule } from './departments/departments.module';
|
||||
import { CommonModule } from './common/common.module';
|
||||
import { ArchiveModule } from './archive/archive.module';
|
||||
import { ExpenseTypesModule } from './expense-types/expense-types.module';
|
||||
@@ -71,7 +68,6 @@ import { ExpenseTypesModule } from './expense-types/expense-types.module';
|
||||
import { IntegrationConfig, IntegrationConfigDetail } from './integration/entities/integration-config.entity';
|
||||
import { IntegrationConfigModule } from './integration/config/config.module';
|
||||
|
||||
import { CampusScopeMiddleware } from './common/campus-scope.middleware';
|
||||
@Module({
|
||||
imports: [
|
||||
ConfigModule.forRoot({ isGlobal: true }),
|
||||
@@ -113,8 +109,6 @@ import { CampusScopeMiddleware } from './common/campus-scope.middleware';
|
||||
AttendanceRecord,
|
||||
DingAttendanceRaw,
|
||||
Notification,
|
||||
Department,
|
||||
UserDepartment,
|
||||
StudentProfile,
|
||||
StudentEnrollment,
|
||||
ExamScore,
|
||||
@@ -167,7 +161,6 @@ import { CampusScopeMiddleware } from './common/campus-scope.middleware';
|
||||
ClassroomRentalsModule,
|
||||
SyncModule,
|
||||
NotificationsModule,
|
||||
DepartmentsModule,
|
||||
CommonModule,
|
||||
ArchiveModule,
|
||||
IntegrationConfigModule,
|
||||
@@ -179,8 +172,4 @@ import { CampusScopeMiddleware } from './common/campus-scope.middleware';
|
||||
{ provide: APP_GUARD, useClass: PermissionGuard },
|
||||
],
|
||||
})
|
||||
export class AppModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer.apply(CampusScopeMiddleware).forRoutes('*');
|
||||
}
|
||||
}
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user