Skip to content

Commit

Permalink
split deletion module and deletion-api.module
Browse files Browse the repository at this point in the history
  • Loading branch information
sszafGCA committed Nov 23, 2023
1 parent 994262f commit 72e7f31
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 40 deletions.
45 changes: 45 additions & 0 deletions apps/server/src/modules/deletion/deletion-api.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Module } from '@nestjs/common';
import { DeletionModule } from '@modules/deletion';
import { AccountModule } from '@modules/account';
import { ClassModule } from '@modules/class';
import { LearnroomModule } from '@modules/learnroom';
import { FilesModule } from '@modules/files';
import { PseudonymModule } from '@modules/pseudonym';
import { LessonModule } from '@modules/lesson';
import { TeamsModule } from '@modules/teams';
import { UserModule } from '@modules/user';
import { LoggerModule } from '@src/core/logger';
import { AuthenticationModule } from '@modules/authentication';
import { RocketChatUserModule } from '@modules/rocketchat-user';
import { Configuration } from '@hpi-schul-cloud/commons';
import { RocketChatModule } from '@modules/rocketchat';
import { DeletionRequestsController } from './controller/deletion-requests.controller';
import { DeletionExecutionsController } from './controller/deletion-executions.controller';
import { DeletionRequestUc } from './uc';

@Module({
imports: [
DeletionModule,
AccountModule,
ClassModule,
LearnroomModule,
FilesModule,
LessonModule,
PseudonymModule,
TeamsModule,
UserModule,
LoggerModule,
AuthenticationModule,
RocketChatUserModule,
RocketChatModule.forRoot({
uri: Configuration.get('ROCKET_CHAT_URI') as string,
adminId: Configuration.get('ROCKET_CHAT_ADMIN_ID') as string,
adminToken: Configuration.get('ROCKET_CHAT_ADMIN_TOKEN') as string,
adminUser: Configuration.get('ROCKET_CHAT_ADMIN_USER') as string,
adminPassword: Configuration.get('ROCKET_CHAT_ADMIN_PASSWORD') as string,
}),
],
controllers: [DeletionRequestsController, DeletionExecutionsController],
providers: [DeletionRequestUc],
})
export class DeletionApiModule {}
38 changes: 0 additions & 38 deletions apps/server/src/modules/deletion/deletion.module.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,16 @@
import { Module } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Configuration } from '@hpi-schul-cloud/commons';
import { LoggerModule } from '@src/core/logger';
import { AuthenticationModule } from '@modules/authentication/authentication.module';
import { AccountModule } from '@modules/account';
import { ClassModule } from '@modules/class';
import { LearnroomModule } from '@modules/learnroom';
import { LessonModule } from '@modules/lesson';
import { PseudonymModule } from '@modules/pseudonym';
import { TeamsModule } from '@modules/teams';
import { UserModule } from '@modules/user';
import { RocketChatModule } from '@modules/rocketchat';
import { FilesModule } from '@modules/files';
import { DeletionRequestService } from './services/deletion-request.service';
import { DeletionRequestRepo } from './repo/deletion-request.repo';
import { DeletionRequestsController } from './controller/deletion-requests.controller';
import { DeletionExecutionsController } from './controller/deletion-executions.controller';
import { XApiKeyConfig } from '../authentication/config/x-api-key.config';
import { DeletionRequestUc } from './uc/deletion-request.uc';
import { DeletionLogService } from './services/deletion-log.service';
import { RocketChatUserModule } from '../rocketchat-user';
import { DeletionLogRepo } from './repo';

@Module({
imports: [
LoggerModule,
AuthenticationModule,
AccountModule,
ClassModule,
LearnroomModule,
LessonModule,
PseudonymModule,
TeamsModule,
UserModule,
RocketChatModule.forRoot({
uri: Configuration.get('ROCKET_CHAT_URI') as string,
adminId: Configuration.get('ROCKET_CHAT_ADMIN_ID') as string,
adminToken: Configuration.get('ROCKET_CHAT_ADMIN_TOKEN') as string,
adminUser: Configuration.get('ROCKET_CHAT_ADMIN_USER') as string,
adminPassword: Configuration.get('ROCKET_CHAT_ADMIN_PASSWORD') as string,
}),
RocketChatUserModule,
FilesModule,
],
controllers: [DeletionRequestsController, DeletionExecutionsController],
providers: [
DeletionRequestRepo,
DeletionLogRepo,
ConfigService<XApiKeyConfig, true>,
DeletionRequestUc,
DeletionLogService,
DeletionRequestService,
],
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/modules/server/admin-api.server.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { FileEntity } from '@modules/files/entity';
import { FileRecord } from '@modules/files-storage/entity';
import { RedisClient } from 'redis';
import { REDIS_CLIENT, RedisModule } from '@src/infra/redis';
import { DeletionModule } from '../deletion';
import { defaultMikroOrmOptions, setupSessions } from './server.module';
import { serverConfig } from './server.config';
import { AdminApiServerController } from './controller';
import { DeletionApiModule } from '../deletion/deletion-api.module';

const serverModules = [ConfigModule.forRoot(createConfigModuleOptions(serverConfig)), DeletionModule];
const serverModules = [ConfigModule.forRoot(createConfigModuleOptions(serverConfig)), DeletionApiModule];

@Module({
imports: [
Expand Down
3 changes: 3 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
},
"CTL_TOOLS": {
"EXTERNAL_TOOL_MAX_LOGO_SIZE_IN_BYTES": 300000
},
"ADMIN_API": {
"ALLOWED_API_KEYS": "1ab2c3d4e5f61ab2c3d4e5f6dasda"
}
}

0 comments on commit 72e7f31

Please sign in to comment.