fennec-be/src/pipelines/pipelines.module.ts
2021-07-20 20:37:46 +08:00

30 lines
1.1 KiB
TypeScript

import { Module } from '@nestjs/common';
import { PipelinesResolver } from './pipelines.resolver';
import { PipelinesService } from './pipelines.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Pipeline } from './pipeline.entity';
import { CommitLogsResolver } from './commit-logs.resolver';
import { PipelineTasksModule } from '../pipeline-tasks/pipeline-tasks.module';
import { ReposModule } from '../repos/repos.module';
import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { CommonsModule } from '../commons/commons.module';
@Module({
imports: [
CommonsModule,
TypeOrmModule.forFeature([Pipeline]),
PipelineTasksModule,
RabbitMQModule.forRootAsync(RabbitMQModule, {
imports: [ConfigModule],
useFactory: (configService: ConfigService) => ({
uri: configService.get<string>('db.rabbitmq.uri'),
exchanges: [],
}),
inject: [ConfigService],
}),
],
providers: [PipelinesResolver, PipelinesService, CommitLogsResolver],
})
export class PipelinesModule {}