mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-10 18:49:08 +00:00
REFACTOR: Project Pattern and AuthClient (DUC)
This commit is contained in:
+83
-38
@@ -1,44 +1,89 @@
|
||||
import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
|
||||
import { InputGrpcClientModule } from './inputs/input-grpc-client.module';
|
||||
import { UsersGrpcClientModule } from './users-grpc-client/users-grpc-client.module';
|
||||
import { OutputsModule } from './outputs/outputs.module';
|
||||
import { EnrichmentModule } from './enrichment/enrichment.module';
|
||||
import { TransformationsModule } from './transformations/transformations.module';
|
||||
import { PipelinesModule } from './pipelines/pipelines.module';
|
||||
import { RestInputsModule } from './rest/rest-inputs/rest-inputs.module';
|
||||
import { RestOutputsModule } from './rest/rest-outputs/rest-outputs.module';
|
||||
import { RestEnrichmentsModule } from './rest/rest-enrichments/rest-enrichments.module';
|
||||
import { RestTransformationsModule } from './rest/rest-transformations/rest-transformations.module';
|
||||
import { RestPipelinesModule } from './rest/rest-pipelines/rest-pipelines.module';
|
||||
import { RestUserModule } from './rest/rest-user/rest-user.module';
|
||||
import { RestFactoryModule } from './rest/rest-factory/rest-factory.module';
|
||||
import { LoggerMiddleware } from './middlewares/authentication';
|
||||
import { RestInputsController } from './rest/rest-inputs/rest-inputs.controller';
|
||||
import { RestOutputsController } from './rest/rest-outputs/rest-outputs.controller';
|
||||
import { RestTransformationsController } from './rest/rest-transformations/rest-transformations.controller';
|
||||
import { RestPipelinesController } from './rest/rest-pipelines/rest-pipelines.controller';
|
||||
import { RestEnrichmentsController } from './rest/rest-enrichments/rest-enrichments.controller';
|
||||
import { RestFactoryController } from './rest/rest-factory/rest-factory.controller';
|
||||
import { HealthModule } from './health/health.module';
|
||||
@Module({
|
||||
imports: [
|
||||
RestInputsModule, RestOutputsModule, RestEnrichmentsModule, RestTransformationsModule, RestPipelinesModule, RestUserModule, RestFactoryModule, HealthModule,
|
||||
// InputGrpcClientModule,
|
||||
//OutputsModule,
|
||||
//EnrichmentModule,
|
||||
//TransformationsModule,
|
||||
//PipelinesModule
|
||||
],
|
||||
controllers: [],
|
||||
providers: [],
|
||||
})
|
||||
export class AppModule implements NestModule{
|
||||
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
||||
import { ClientsModule } from '@nestjs/microservices';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
||||
import { LoggerMiddleware } from './middlewares/authentication';
|
||||
|
||||
// import { InputsController } from './modules/inputs/inputs.controller';
|
||||
// import { TransformationsController } from './modules/transformations/transformations.controller';
|
||||
// import { OutputsController } from './modules/outputs/outputs.controllers';
|
||||
// import { PipelinesController } from './modules/pipelines/pipelines.controller';
|
||||
import { AuthController } from './modules/auth/auth.controller';
|
||||
|
||||
import { InputsService } from './modules/inputs/inputs.service';
|
||||
import { TransformationsService } from './modules/transformations/transformations.service';
|
||||
import { OutputsService } from './modules/outputs/outputs.service';
|
||||
// import { PipelinesService } from './modules/pipelines/pipelines.service';
|
||||
// import { AuthService } from './modules/auth/auth.service';
|
||||
|
||||
// import { InputsClientService } from './clients/inputs/client.service';
|
||||
// import { TransformationsClientService } from './clients/transformations/client.service';
|
||||
// import { OutputsClientService } from './clients/outputs/client.service';
|
||||
// import { PipelinesClientService } from './clients/pipelines/client.service';
|
||||
import { AuthClientService } from './clients/auth/client.service';
|
||||
|
||||
// import { InputsClientConfiguration } from './clients/inputs/client.config';
|
||||
// import { OutputsClientConfiguration } from './clients/outputs/client.config';
|
||||
// import { TransformationsClientConfiguration } from './clients/transformations/client.config';
|
||||
import { AuthClient } from './clients/auth/client.config';
|
||||
|
||||
const authClient = new AuthClient();
|
||||
|
||||
@Module({
|
||||
controllers: [
|
||||
// InputsController,
|
||||
// TransformationsController,
|
||||
// OutputsController,
|
||||
// PipelinesController,
|
||||
AuthController,
|
||||
],
|
||||
providers: [
|
||||
InputsService,
|
||||
TransformationsService,
|
||||
OutputsService,
|
||||
// PipelinesService,
|
||||
// AuthService,
|
||||
// InputsClientService,
|
||||
// TransformationsClientService,
|
||||
// OutputsClientService,
|
||||
// PipelinesClientService,
|
||||
AuthClientService,
|
||||
],
|
||||
imports: [
|
||||
ConfigModule.forRoot({
|
||||
isGlobal: true,
|
||||
}),
|
||||
|
||||
ClientsModule.register([
|
||||
// {
|
||||
// name: 'INPUTS_PACKAGE',
|
||||
// ...InputsClientConfiguration,
|
||||
// },
|
||||
|
||||
// {
|
||||
// name: 'TRANSFORMATIONS_PACKAGE',
|
||||
// ...TransformationsClientConfiguration,
|
||||
// },
|
||||
// {
|
||||
// name: 'OUTPUTS_PACKAGE',
|
||||
// ...OutputsClientConfiguration,
|
||||
// },
|
||||
{
|
||||
name: 'AUTH_PACKAGE',
|
||||
...authClient.config(),
|
||||
},
|
||||
]),
|
||||
],
|
||||
})
|
||||
export class AppModule implements NestModule {
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer
|
||||
.apply(LoggerMiddleware)
|
||||
.forRoutes(RestInputsController,RestOutputsController,RestTransformationsController,RestPipelinesController,RestEnrichmentsController,RestFactoryController)
|
||||
.forRoutes
|
||||
// InputsController,
|
||||
// TransformationsController,
|
||||
// OutputsController,
|
||||
// PipelinesController,
|
||||
();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user