mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-24 03:46:37 +02:00
1481e14c12
* add protoc gen ecode * add protobuf example
34 lines
664 B
Protocol Buffer
34 lines
664 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package user.api;
|
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
option go_package = "api";
|
|
|
|
enum UserErrCode {
|
|
OK = 0;
|
|
UserNotExist = -404;
|
|
UserUpdateNameFailed = 10000;
|
|
}
|
|
|
|
message Info {
|
|
int64 mid = 1 [(gogoproto.jsontag) = "mid"];
|
|
string name = 2 [(gogoproto.jsontag) = "name"];
|
|
string sex = 3 [(gogoproto.jsontag) = "sex"];
|
|
string face = 4 [(gogoproto.jsontag) = "face"];
|
|
string sign = 5 [(gogoproto.jsontag) = "sign"];
|
|
}
|
|
|
|
message UserReq {
|
|
int64 mid = 1 [(gogoproto.moretags) = "validate:\"gt=0,required\""];
|
|
}
|
|
|
|
message InfoReply {
|
|
Info info = 1;
|
|
}
|
|
|
|
service User {
|
|
rpc Info(UserReq) returns (InfoReply);
|
|
}
|