这里我就从简了,省略了更新,删除等操作,只写了Create
和Get
,用作示例。
app/word/manifest/protobuf/words/v1/words.proto
syntax = "proto3";
package words.v1;
option go_package = "proxima/app/word/api/words/v1";
import "pbentity/words.proto";
service Words{
rpc Create(CreateReq) returns (CreateRes) {}
rpc Get(GetReq) returns (GetRes) {}
}
message CreateReq {
uint32 uid = 1; // v:required
string word = 2; // v:required
string definition = 3; // v:required
}
message CreateRes {
uint32 id = 1;
}
message GetReq {
uint32 id = 1; // v:required
}
message GetRes {
pbentity.Words words = 1;
}