A progressive Node.js framework for building efficient and scalable server-side applications.
Modulo NestJS para envio de logs do sistema.
$ npm i forma-log
AppModule.ts
import { Module } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { LogServiceModule } from 'forma-log';
@Module({
imports: [
LogServiceModule.registerAsync({
useFactory: (configService: ConfigService) => {
return {
awsId: configService.get('ACCOUNT_ID_AWS'),
awsKey: configService.get('ACCESS_KEY_AWS'),
awsRegion: configService.get('SQS_REGION'),
awsSecret: configService.get('SECRET_KEY_AWS'),
irSistema: 1,
};
},
inject: [ConfigService],
}),
],
providers: [],
controllers: [],
})
export class AppModule {}
AlteraPermissaoUsuario.ts
import { ILogService } from 'forma-log';
export class AlteraPermissaoUsuario
{
async executar(
{ idUsuario, irEmpresa }: { idUsuario: number, irEmpresa: number },
): Promise<string> {
await this.logService.logar({
idUsuario,
irEmpresa,
codigoFrase: 'ANY-001',
parametros: [1],
});
return "Permissao alterada com sucesso!"
}
}
Nest is MIT licensed.