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.
 
 

97 lines
1.6 KiB

syntax = "proto3";
import "google/protobuf/empty.proto";
//import "postal.proto";
option go_package = "./chat";
service Chat {
rpc Send(ReqSend) returns (ResSend);
rpc RoomSend(ReqRoomSend) returns (ResSend);
rpc RoomCreate(ReqRoomCreate) returns (ResRoomCreate);
rpc RoomJoin(ReqRoomJoin) returns (google.protobuf.Empty);
rpc RoomLeave(ReqRoomLeave) returns (google.protobuf.Empty);
rpc RoomKickOut(ReqRoomKickOut) returns (google.protobuf.Empty);
rpc RoomInfo(ReqRoomInfo) returns (ResRoomInfo);
rpc RoomDissolve(ReqRoomDissolve) returns (google.protobuf.Empty);
rpc RoomList(ReqRoomList) returns (ResRoomList);
}
message ChatMessage {
int32 type = 1; // 0默认单聊消息, 1群消息
string sender = 2;
string gid = 3;
string content = 15;
}
message ReqSend {
string receiver = 2;
string content = 3; // 消息格式化器 [img:img_id][file:file_id]text...
}
message ReqRoomSend {
string Rid = 1;
string message = 2;
}
message ResSend {
int32 status = 1; // 1已发送,2已接收
string result = 2;
}
message Room {
string rid = 1;
string masterUid = 2;
int32 userLimit = 3;
int32 userNum = 4;
string gname = 5;
string createUid = 6;
int64 createAt = 7;
}
message ReqRoomCreate {
string rname = 2;
}
message ResRoomCreate {
Room room = 1;
}
message ReqRoomJoin {
string rid = 1;
}
message ReqRoomLeave {
string rid = 1;
}
message ReqRoomKickOut {
string rid = 1;
string uid = 2;
}
message ReqRoomInfo {
string rid = 1;
}
message ResRoomInfo {
Room room = 1;
}
message ReqRoomDissolve {
string rid = 1;
}
message ReqRoomList {
}
message ResRoomList {
repeated Room rooms = 1;
}