67 lines
2.1 KiB
Protocol Buffer
67 lines
2.1 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package pb;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "rpc_create_user.proto";
|
|
import "rpc_login_user.proto";
|
|
import "rpc_update_user.proto";
|
|
import "rpc_verify_email.proto";
|
|
import "protoc-gen-openapiv2/options/annotations.proto";
|
|
|
|
option go_package = "github.com/FernandoJVideira/simple_bank/pb";
|
|
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
|
info: {
|
|
title: "Simple Bank API"
|
|
version: "0.0.1"
|
|
contact: {
|
|
name: "fvideira"
|
|
url: "https://github.com/FernandoJVideira/simple_bank"
|
|
email: "[email protected]"
|
|
};
|
|
};
|
|
};
|
|
|
|
service SimpleBank {
|
|
rpc CreateUser (CreateUserRequest) returns (CreateUserResponse){
|
|
option (google.api.http) = {
|
|
post: "/v1/create_user"
|
|
body: "*"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
description: "Create a new user in the Simple Bank system."
|
|
summary: "Create User"
|
|
};
|
|
}
|
|
rpc LoginUser (LoginUserRequest) returns (LoginUserResponse){
|
|
option (google.api.http) = {
|
|
post: "/v1/login_user"
|
|
body: "*"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
description: "Login an existing user in the Simple Bank system."
|
|
summary: "Login User"
|
|
};
|
|
}
|
|
rpc VerifyEmail (VerifyEmailRequest) returns (VerifyEmailResponse){
|
|
option (google.api.http) = {
|
|
get: "/v1/verify_email"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
description: "Verify user's email in the Simple Bank system."
|
|
summary: "Verify Email"
|
|
};
|
|
}
|
|
rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse){
|
|
option (google.api.http) = {
|
|
patch: "/v1/update_user"
|
|
body: "*"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
description: "Update an existing user in the Simple Bank system."
|
|
summary: "Update User"
|
|
};
|
|
}
|
|
}
|