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.
91 lines
1.5 KiB
91 lines
1.5 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 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 gid = 1; |
|
string message = 2; |
|
} |
|
|
|
message ResSend { |
|
int32 status = 1; // 1已发送,2已接收 |
|
string result = 2; |
|
} |
|
|
|
message Group { |
|
string gid = 1; |
|
string masterUid = 2; |
|
int32 userLimit = 3; |
|
int32 userNum = 4; |
|
string gname = 5; |
|
string createUid = 6; |
|
int64 createAt = 7; |
|
} |
|
|
|
message ReqRoomCreate { |
|
string gname = 2; |
|
} |
|
|
|
message ResRoomCreate { |
|
Group group = 1; |
|
} |
|
|
|
message ReqRoomJoin { |
|
string gid = 1; |
|
} |
|
|
|
message ReqRoomLeave { |
|
string gid = 1; |
|
} |
|
|
|
message ReqRoomKickOut { |
|
string gid = 1; |
|
string uid = 2; |
|
} |
|
|
|
message ReqRoomInfo { |
|
string gid = 1; |
|
} |
|
|
|
message ResRoomInfo { |
|
Group group = 1; |
|
} |
|
|
|
message ReqRoomList { |
|
} |
|
|
|
message ResRoomList { |
|
repeated Group groups = 1; |
|
}
|
|
|