代码初始化
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package demo.crosslink;
|
||||
|
||||
option java_package = "com.huangzj.cross.gen";
|
||||
option java_multiple_files = true;
|
||||
|
||||
message CrossPing {
|
||||
string trace = 1;
|
||||
int32 nonce = 2;
|
||||
}
|
||||
|
||||
message CrossPong {
|
||||
string trace = 1;
|
||||
int32 nonce = 2;
|
||||
int64 cross_time_ms = 3;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,93 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package demo.cmd;
|
||||
|
||||
option java_package = "com.huangzj.cmd.gen";
|
||||
option java_multiple_files = true;
|
||||
|
||||
|
||||
enum Service1_Method{
|
||||
Default1 = 0;
|
||||
Method1 = 1;
|
||||
}
|
||||
|
||||
|
||||
enum Service2_Method{
|
||||
Default2 = 0;
|
||||
Method2 = 1;
|
||||
}
|
||||
|
||||
|
||||
enum Service3_Method{
|
||||
Default3 = 0;
|
||||
Method3 = 1;
|
||||
}
|
||||
|
||||
/** 区服 ↔ 跨服链路控制(注册、心跳),不经客户端 TCP。 */
|
||||
enum Service4_Method {
|
||||
Default4 = 0;
|
||||
Register = 1;
|
||||
Heartbeat = 2;
|
||||
}
|
||||
|
||||
service Service1Service {
|
||||
rpc GetUser (CmdEchoCts) returns (CmdEchoStc);
|
||||
}
|
||||
|
||||
|
||||
message CmdRpcEnvelope {
|
||||
uint32 service_id = 1;
|
||||
uint32 method_id = 2;
|
||||
bytes payload = 3;
|
||||
int32 cross_ret = 4;
|
||||
/** 区服↔跨服链路上对齐请求与响应;客户端 TCP 可保持默认 0。 */
|
||||
uint32 link_seq = 5;
|
||||
}
|
||||
|
||||
message CmdEchoCts {
|
||||
string text = 1;
|
||||
}
|
||||
|
||||
message CmdEchoStc {
|
||||
string text = 1;
|
||||
int64 server_time_ms = 2;
|
||||
}
|
||||
|
||||
message CrossForwardCts {
|
||||
string trace = 1;
|
||||
}
|
||||
|
||||
message CrossForwardStc {
|
||||
string trace = 1;
|
||||
int64 cross_time_ms = 2;
|
||||
}
|
||||
|
||||
message CrossProxyCts {
|
||||
string trace = 1;
|
||||
}
|
||||
|
||||
message CrossProxyStc {
|
||||
string trace = 1;
|
||||
int64 cross_time_ms = 2;
|
||||
/** 路径2:区服在跨服返回后再追加的说明,证明「经区服二次处理」。 */
|
||||
string server_note = 3;
|
||||
}
|
||||
|
||||
message CrossLinkRegisterCts {
|
||||
string server_id = 1;
|
||||
string token = 2;
|
||||
}
|
||||
|
||||
message CrossLinkRegisterStc {
|
||||
bool ok = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
message CrossLinkHeartbeatCts {
|
||||
int64 client_time_ms = 1;
|
||||
}
|
||||
|
||||
message CrossLinkHeartbeatStc {
|
||||
int64 client_time_ms = 1;
|
||||
int64 cross_time_ms = 2;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package demo.comm;
|
||||
|
||||
option java_package = "com.huangzj.comm.gen";
|
||||
option java_outer_classname = "EchoProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
message EchoRequest {
|
||||
string text = 1;
|
||||
}
|
||||
|
||||
message EchoResponse {
|
||||
string text = 1;
|
||||
int64 server_time_ms = 2;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package demo.cmd;
|
||||
|
||||
option java_package = "com.huangzj.cmd.gen";
|
||||
option java_multiple_files = true;
|
||||
|
||||
enum PbService {
|
||||
Default = 0;
|
||||
Service_1 = 1;
|
||||
Service_2 = 2;
|
||||
Service_3 = 3;
|
||||
Service_4 = 4;
|
||||
}
|
||||
Reference in New Issue
Block a user