Skip to content

Instantly share code, notes, and snippets.

@trongdth
Created November 3, 2019 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trongdth/339d65d9f8ce1015c619dce05c35b058 to your computer and use it in GitHub Desktop.
Save trongdth/339d65d9f8ce1015c619dce05c35b058 to your computer and use it in GitHub Desktop.
syntax = "proto3";
package protobuf;
import "base.proto";
service UserSrv {
rpc CreateUser (UserReq) returns (UserRes) {}
rpc ReadUser (UserReq) returns (UserRes) {}
}
// UserReq represents an user query
message UserReq {
BaseReq req = 1;
UserInfo user = 2;
}
// UserInfo
message UserInfo {
uint32 id = 1;
string fullName = 2;
string email = 3;
string password = 4;
}
// UserRes : result + user info
message UserRes {
bool result = 1;
UserInfo user = 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment