mirror of
https://github.com/dadosfera/maestro.git
synced 2026-12-05 00:40:04 +00:00
added swagger + outputs module
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user