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.
88 lines
1.5 KiB
88 lines
1.5 KiB
syntax = "proto3"; |
|
|
|
import "google/protobuf/empty.proto"; |
|
option go_package = "./chat"; |
|
|
|
service AuthService { |
|
rpc Send(ReqSendChat) returns (ResSendChat); |
|
|
|
rpc GroupSend(ReqSendGroupChat) returns (ResSendChat); |
|
|
|
rpc GroupCreate(ReqGroupCreate) returns (ResGroupCreate); |
|
|
|
rpc GroupJoin(ReqGroupJoin) returns (google.protobuf.Empty); |
|
|
|
rpc GroupLeave(ReqGroupLeave) returns (google.protobuf.Empty); |
|
|
|
rpc GroupKickOut(ReqGroupKickOut) returns (google.protobuf.Empty); |
|
|
|
rpc GroupInfo(ReqGroupInfo) returns (ResGroupInfo); |
|
|
|
rpc GroupList(ReqGroupList) returns (ResGroupList); |
|
} |
|
|
|
message ChatMessage { |
|
string sender = 1; |
|
string content = 7; |
|
} |
|
|
|
message ReqSendChat { |
|
string receiver = 2; |
|
string content = 3; // 消息格式化器 [img:img_id][file:file_id]text... |
|
} |
|
|
|
message ReqSendGroupChat { |
|
string gid = 1; |
|
string message = 2; |
|
} |
|
|
|
message ResSendChat { |
|
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 ReqGroupCreate { |
|
string gname = 2; |
|
} |
|
|
|
message ResGroupCreate { |
|
Group group = 1; |
|
} |
|
|
|
message ReqGroupJoin { |
|
string gid = 1; |
|
} |
|
|
|
message ReqGroupLeave { |
|
string gid = 1; |
|
} |
|
|
|
message ReqGroupKickOut { |
|
string gid = 1; |
|
string uid = 2; |
|
} |
|
|
|
message ReqGroupInfo { |
|
string gid = 1; |
|
} |
|
|
|
message ResGroupInfo { |
|
Group group = 1; |
|
} |
|
|
|
message ReqGroupList { |
|
} |
|
|
|
message ResGroupList { |
|
repeated Group groups = 1; |
|
}
|
|
|