You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.9 KiB

syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.examples.protobuf";
option java_outer_classname = "ProtobufProto";
package protobuf;
// The AccServer service definition.
service AccServer {
// 查询用户是否在线
rpc QueryUsersOnline (QueryUsersOnlineReq) returns (QueryUsersOnlineRsp) {
}
// 发送消息
rpc SendMsg (SendMsgReq) returns (SendMsgRsp) {
}
// 给这台机器的房间内所有用户发送消息
rpc SendMsgAll (SendMsgAllReq) returns (SendMsgAllRsp) {
}
// 获取用户列表
rpc GetUserList (GetUserListReq) returns (GetUserListRsp) {
}
}
// 查询用户是否在线
message QueryUsersOnlineReq {
uint32 appId = 1; // AppID
string userId = 2; // 用户ID
}
message QueryUsersOnlineRsp {
uint32 retCode = 1;
string errMsg = 2;
bool online = 3;
}
// 发送消息
message SendMsgReq {
string seq = 1; // 序列号
uint32 appId = 2; // appId/房间Id
string userId = 3; // 用户ID
string cms = 4; // cms 动作: msg/enter/exit
string type = 5; // type 消息类型,默认是 text
string msg = 6; // msg
bool isLocal = 7; // 是否查询本机 acc内部调用为:true(本机查询不到即结束)
}
message SendMsgRsp {
uint32 retCode = 1;
string errMsg = 2;
string sendMsgId = 3;
}
// 给这台机器的房间内所有用户发送消息
message SendMsgAllReq {
string seq = 1; // 序列号
uint32 appId = 2; // appId/房间Id
string userId = 3; // 不发送的用户ID
string cms = 4; // cms 动作: msg/enter/exit
string type = 5; // type 消息类型,默认是 text
string msg = 6; // msg
}
message SendMsgAllRsp {
uint32 retCode = 1;
string errMsg = 2;
string sendMsgId = 3;
}
// 获取用户列表
message GetUserListReq {
uint32 appId = 1;
}
message GetUserListRsp {
uint32 retCode = 1;
string errMsg = 2;
repeated string userId = 3;
}