Client Refactor

This commit is contained in:
Victor Radael
2022-08-12 12:24:22 -03:00
parent 6dd894e11b
commit 3356f306b3
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import {
import { InputPackages, InputProtoFilePath } from 'protospack';
export class InputsGrpcClient {
public name = 'InputsGrpcClient';
private config: GrpcOptions = {
transport: Transport.GRPC,
options: {
@@ -22,7 +23,7 @@ export class InputsGrpcClient {
},
};
providerOptions: ClientProviderOptions = {
name: 'InputsGrpcClient',
name: this.name,
...this.config,
};
}
+2 -1
View File
@@ -29,6 +29,7 @@ import {
objectCamelToSnake,
} from 'src/utils/CaseConverter';
import { IIdRequest, UpdateInputRequest } from './dtos/old_interfaces';
import { InputsGrpcClient } from './inputs-client.config';
@Injectable()
@@ -231,7 +232,7 @@ export class InputsService {
constructor(
@Inject(DadosferaLogger)
dadosferaLogger: DadosferaLogger,
@Inject('InputsGrpcClient') private readonly grpcClient: ClientGrpc,
@Inject(InputsGrpcClient.name) private readonly grpcClient: ClientGrpc,
) {
this.logger = dadosferaLogger.logger;
}