2021-07-14 11:48:20 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package test;
|
|
|
|
|
2021-10-27 01:24:35 +03:00
|
|
|
option go_package = "go.unistack.org/micro-tests/flow/proto;pb";
|
2021-07-14 11:48:20 +03:00
|
|
|
|
2021-08-17 01:11:23 +03:00
|
|
|
//import "tag/tag.proto";
|
2021-07-14 11:48:20 +03:00
|
|
|
import "api/annotations.proto";
|
2021-10-27 01:24:35 +03:00
|
|
|
import "openapiv3/annotations.proto";
|
2021-08-17 01:11:23 +03:00
|
|
|
//import "google/protobuf/wrappers.proto";
|
2021-07-14 11:48:20 +03:00
|
|
|
|
|
|
|
service TestService {
|
|
|
|
//option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
|
|
|
|
rpc LookupUser(LookupUserReq) returns (LookupUserRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-07-14 11:48:20 +03:00
|
|
|
operation_id: "LookupUser";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-07-14 11:48:20 +03:00
|
|
|
};
|
2021-07-16 00:41:10 +03:00
|
|
|
option (micro.api.http) = { get: "/v1/user/{name}"; };
|
2023-01-07 19:16:48 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: "5s"; };
|
2021-07-14 11:48:20 +03:00
|
|
|
};
|
2021-07-16 00:41:10 +03:00
|
|
|
rpc UpdateUser(UpdateUserReq) returns (UpdateUserRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-07-16 00:41:10 +03:00
|
|
|
operation_id: "UpdateUser";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-07-16 00:41:10 +03:00
|
|
|
};
|
|
|
|
option (micro.api.http) = { put: "/v1/user/{name}"; body:"*"; };
|
2023-01-07 19:16:48 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: "5s"; };
|
2021-07-16 00:41:10 +03:00
|
|
|
};
|
|
|
|
rpc DeleteUser(DeleteUserReq) returns (DeleteUserRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-07-16 00:41:10 +03:00
|
|
|
operation_id: "DeleteUser";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-07-16 00:41:10 +03:00
|
|
|
};
|
|
|
|
option (micro.api.http) = { delete: "/v1/user/{name}"; };
|
2023-01-07 19:16:48 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: "5s"; };
|
2021-07-16 00:41:10 +03:00
|
|
|
};
|
|
|
|
rpc MailUser(MailUserReq) returns (MailUserRsp) {
|
2021-10-27 01:24:35 +03:00
|
|
|
option (micro.openapiv3.openapiv3_operation) = {
|
2021-07-16 00:41:10 +03:00
|
|
|
operation_id: "MailUser";
|
2021-08-17 01:11:23 +03:00
|
|
|
responses: {
|
2021-10-27 01:24:35 +03:00
|
|
|
default: {
|
|
|
|
reference: {
|
|
|
|
_ref: ".test.Error";
|
2021-08-17 01:11:23 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-07-16 00:41:10 +03:00
|
|
|
};
|
|
|
|
option (micro.api.http) = { post: "/v1/user/{name}/mail"; body:"*"; };
|
2023-01-07 19:16:48 +03:00
|
|
|
option (micro.api.micro_method) = { timeout: "5s"; };
|
2021-07-16 00:41:10 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
message MailUserReq {
|
|
|
|
string name = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
message MailUserRsp {
|
|
|
|
string status = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
message UpdateUserReq {
|
|
|
|
string name = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
message UpdateUserRsp {
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
message DeleteUserReq {
|
|
|
|
string name = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
message DeleteUserRsp {
|
|
|
|
|
2021-07-14 11:48:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
message LookupUserReq {
|
|
|
|
string name = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
message LookupUserRsp {
|
|
|
|
string birthday = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Error {
|
|
|
|
string msg = 1;
|
|
|
|
};
|