You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
654 B
Protocol Buffer
34 lines
654 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
option java_package = "com.baiye.common.protobuf";
|
|
option java_outer_classname = "MessageModule";
|
|
|
|
// 请求还是响应
|
|
enum MessageType{
|
|
REQUEST = 0;
|
|
RESPONSE = 1;
|
|
}
|
|
|
|
// 响应类型
|
|
enum ResultType{
|
|
SUCCESS = 0;
|
|
FAILURE = 1;
|
|
SYS_ERROR = 2;
|
|
}
|
|
|
|
// 定义数据包的结构 前5个为包头定义 后面是数据体
|
|
message Message{
|
|
// 请求标记
|
|
int64 crcCode = 1;
|
|
// 请求类型
|
|
MessageType messageType = 2;
|
|
// 响应类型
|
|
ResultType resultType = 3;
|
|
// 模块类型 是什么具体的业务对象
|
|
string module = 4;
|
|
// 具体业务对象的操作
|
|
string cmd = 5;
|
|
// 数据体
|
|
bytes body = 6;
|
|
|
|
} |