added swagger + outputs module

This commit is contained in:
rodrigo.zamboni
2022-01-19 13:15:53 -03:00
parent 70d3f5d0a1
commit 79ed958b83
21 changed files with 4302 additions and 3966 deletions
+2 -2
View File
@@ -6,8 +6,8 @@ export const GrpcClientConfiguration: ClientOptions = {
options: {
//url: `${process.env.USERS_SVC_URL}:${process.env.USERS_SVC_PORT}`,
url: `127.0.0.1:50052`,
package: 'user',
protoPath: join(__dirname, '..', 'proto', 'user.proto'),
package: 'input',
protoPath: join(__dirname, '..', 'proto', 'input.proto'),
loader: {
enums: String,
objects: true,
+11 -1
View File
@@ -1,12 +1,22 @@
import { ApiProperty } from "@nestjs/swagger";
export class CreateInputGrpcClientDto {
@ApiProperty()
cron:string;
@ApiProperty({
description:"Name of the input",
example:"Test Name"
})
name:string;
@ApiProperty()
plugin:string;
@ApiProperty()
values:string;
@ApiProperty()
operation:string;
}
@@ -3,6 +3,4 @@ import { CreateInputGrpcClientDto } from './create-input-grpc-client.dto';
export class UpdateInputGrpcClientDto extends PartialType(
CreateInputGrpcClientDto,
) {
id: number;
}
) {}
@@ -1,4 +1,6 @@
export class InputGrpcClient {
id:string;
cron:string;
+3 -1
View File
@@ -13,8 +13,10 @@ import { UpdateInputGrpcClientDto } from './dto/update-input-grpc-client.dto';
import { InputGrpcClientService } from './input-grpc-client.service';
import { GrpcClientConfiguration } from './config/grpc-client';
import { TestConnectionDTO } from './dto/test-connection-grpc-client.dto';
import { ApiTags } from '@nestjs/swagger';
@Controller('input-grpc-client')
@ApiTags('inputs')
@Controller('input')
export class InputGrpcClientController implements OnModuleInit {
@Client(GrpcClientConfiguration)
private inputServiceClient: ClientGrpc;
+7 -6
View File
@@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto";
service InputService {
rpc Create(CreateInputRequest) returns (InputResponse) {}
rpc Create(CreateInputRequest) returns (Input) {}
rpc Show(IdRequest) returns (Input) {}
rpc List(Empty) returns (ListResponse){}
rpc Update(UpdateInputRequest) returns (Input){}
@@ -32,11 +32,12 @@ message UpdateInputRequest{
}
message Input {
string cronFormated = 1;
string name = 2;
string plugin = 3;
string values = 4;
string operation = 5;
string id = 1;
string cronFormated = 2;
string name = 3;
string plugin = 4;
string values = 5;
string operation = 6;
}
message CreateInputRequest {