From 9b612ce083f69c587e715a60f0142ebf5a9f8859 Mon Sep 17 00:00:00 2001 From: sbriat Date: Thu, 4 May 2023 12:35:05 +0200 Subject: [PATCH] add ad service --- .../adapters/primaries/ad.controller.ts | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/modules/logger/adapters/primaries/ad.controller.ts b/src/modules/logger/adapters/primaries/ad.controller.ts index d10abd9..c0fd7f9 100644 --- a/src/modules/logger/adapters/primaries/ad.controller.ts +++ b/src/modules/logger/adapters/primaries/ad.controller.ts @@ -6,91 +6,91 @@ import { level } from './logger/level.enum'; import loggerOptions from './logger/logger'; @Controller() -export class UserController { +export class AdController { constructor( @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger, ) {} @RabbitSubscribe({ - name: 'loggingUserCreateInfo', + name: 'loggingAdCreateInfo', }) - public async userCreatedInfoHandler(message: string) { - this.logger.configure(loggerOptions('user', level.info, 'info', 'create')); + public async adCreatedInfoHandler(message: string) { + this.logger.configure(loggerOptions('ad', level.info, 'info', 'create')); this.logger.info(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserCreateWarning', + name: 'loggingAdCreateWarning', }) - public async userCreatedWarningHandler(message: string) { + public async adCreatedWarningHandler(message: string) { this.logger.configure( - loggerOptions('user', level.warning, 'warning', 'create'), + loggerOptions('ad', level.warning, 'warning', 'create'), ); this.logger.warning(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserCreateCrit', + name: 'loggingAdCreateCrit', }) - public async userCreatedCriticalHandler(message: string) { + public async adCreatedCriticalHandler(message: string) { this.logger.configure( - loggerOptions('user', level.crit, 'critical', 'create'), + loggerOptions('ad', level.crit, 'critical', 'create'), ); this.logger.crit(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserDeleteInfo', + name: 'loggingAdDeleteInfo', }) - public async userDeletedInfoHandler(message: string) { - this.logger.configure(loggerOptions('user', level.info, 'info', 'delete')); + public async adDeletedInfoHandler(message: string) { + this.logger.configure(loggerOptions('ad', level.info, 'info', 'delete')); this.logger.info(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserDeleteCrit', + name: 'loggingAdDeleteCrit', }) - public async userDeletedCriticalHandler(message: string) { + public async adDeletedCriticalHandler(message: string) { this.logger.configure( - loggerOptions('user', level.crit, 'critical', 'delete'), + loggerOptions('ad', level.crit, 'critical', 'delete'), ); this.logger.crit(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserReadWarning', + name: 'loggingAdReadWarning', }) - public async userReadWarningHandler(message: string) { + public async adReadWarningHandler(message: string) { this.logger.configure( - loggerOptions('user', level.warning, 'warning', 'read'), + loggerOptions('ad', level.warning, 'warning', 'read'), ); this.logger.warning(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserUpdateInfo', + name: 'loggingAdUpdateInfo', }) - public async userUpdatedInfoHandler(message: string) { - this.logger.configure(loggerOptions('user', level.info, 'info', 'update')); + public async adUpdatedInfoHandler(message: string) { + this.logger.configure(loggerOptions('ad', level.info, 'info', 'update')); this.logger.info(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserUpdateCrit', + name: 'loggingAdUpdateCrit', }) - public async userUpdatedCriticalHandler(message: string) { + public async adUpdatedCriticalHandler(message: string) { this.logger.configure( - loggerOptions('user', level.crit, 'critical', 'update'), + loggerOptions('ad', level.crit, 'critical', 'update'), ); this.logger.crit(JSON.parse(message)); } @RabbitSubscribe({ - name: 'loggingUserHealthCrit', + name: 'loggingAdHealthCrit', }) - public async userHealthCriticalHandler(message: string) { + public async adHealthCriticalHandler(message: string) { this.logger.configure( - loggerOptions('user', level.crit, 'critical', 'health'), + loggerOptions('ad', level.crit, 'critical', 'health'), ); this.logger.crit(JSON.parse(message)); }