userCenter.proto 1.76 KB
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
syntax = "proto3";
package userCenter;

option go_package = "protocol/userCenter";

/* id = 1 */
message RouteMessage {
  uint64 uid = 1;
  uint32 msgType = 2;
  bytes payLoad = 3;
}

/* id = 2 */
message RouteMessageRsp {
  uint32 status = 1;
}

/* id = 3 */
message LoginMessage {
  string proxyAddr = 1; // userProxy的地址:ip:port
  string token = 2;
  string clientAddr = 3; // 客户端地址(websocket):ip:port
}

/* id = 4 */
message LoginMessageRsp {
  uint32 status = 1;
  uint64 uid = 2;
}

/* id = 5 */
message LogoutMessage {
  string clientAddr = 1; // 客户端地址(websocket):ip:port
  uint64 uid = 2;
}

/* id = 6 */
message LogoutMessageRsp {
  uint32 status = 1;
}

/* id = 7 */
message MulticastMessage {
  repeated uint64 uids = 1;
  uint32 msgType = 2;
  bytes payLoad = 3;
}

/* id = 8 */
message MulticastMessageRsp {
  repeated uint64 failedUids = 1;
}

/* id = 9 */
message KickMessage {
  uint64 uid = 1;
  string addr = 2;
}

/* id = 10 */
message KickMessageRsp {
  uint32 status = 1;
}

/* id = 11 */
message BroadcastMessage {
  uint32 msgType = 2;
  bytes payLoad = 3;
}

/* id = 12 */
message BroadcastMessageRsp {
  repeated uint64 failedUids = 1;
}

/* id = 13 */
message BizMessage {
  uint64 uid = 1;
  uint32 msgType = 2;
  string payLoad = 3;
}

/* id = 14 */
message BizMessageRsp {
  uint32 status = 1;
}

service Router {
  rpc route(RouteMessage) returns (RouteMessageRsp) {}
  rpc kickUser(KickMessage) returns (KickMessageRsp) {}
}

service User {
  rpc login(LoginMessage) returns (LoginMessageRsp) {}
  rpc logout(LogoutMessage) returns (LogoutMessageRsp) {}
  rpc multicast(MulticastMessage) returns (MulticastMessageRsp) {}
  rpc broadcast(BroadcastMessage) returns (BroadcastMessageRsp) {}
  rpc transmit(BizMessage) returns (BizMessageRsp) {}
}