golang-im聊天
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

logic.ext.proto 7.9 KiB

2 anos atrás
1 ano atrás
2 anos atrás
1 ano atrás
2 anos atrás
2 anos atrás
1 ano atrás
2 anos atrás
1 ano atrás
1 ano atrás
1 ano atrás
2 anos atrás
2 anos atrás
2 anos atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
2 anos atrás
2 anos atrás
1 ano atrás
1 ano atrás
2 anos atrás
1 ano atrás
2 anos atrás
1 ano atrás
2 anos atrás
1 ano atrás
2 anos atrás
1 ano atrás
2 anos atrás
1 ano atrás
1 ano atrás
1 ano atrás
1 ano atrás
2 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. syntax = "proto3";
  2. package pb;
  3. option go_package = "gim/pkg/pb/";
  4. import "common.ext.proto";
  5. import "connect.ext.proto";
  6. service LogicExt {
  7. // 注册设备
  8. rpc RegisterDevice (RegisterDeviceReq) returns (RegisterDeviceResp);
  9. // 发送消息
  10. rpc SendMessage (SendMessageReq) returns (SendMessageResp);
  11. // 撤回消息
  12. rpc RecallMessage (RecallMessageReq) returns (RecallMessageResp);
  13. // 推送消息到房间
  14. rpc PushRoom(PushRoomReq)returns(Empty);
  15. // 发送红包
  16. rpc SendRedPacket (SendRedPacketReq) returns (SendRedPacketResp);
  17. // 添加好友
  18. rpc AddFriend (AddFriendReq) returns (Empty);
  19. // 同意添加好友
  20. rpc AgreeAddFriend (AgreeAddFriendReq) returns (Empty);
  21. // 删除好友
  22. rpc DeleteFriend (DeleteFriendReq) returns (Empty);
  23. // 设置好友信息
  24. rpc SetFriend (SetFriendReq) returns (SetFriendResp);
  25. // 获取好友列表
  26. rpc GetFriends (Empty) returns (GetFriendsResp);
  27. // 创建群组
  28. rpc CreateGroup (CreateGroupReq) returns (CreateGroupResp);
  29. // 更新群组
  30. rpc UpdateGroup (UpdateGroupReq) returns (Empty);
  31. // 获取群组信息
  32. rpc GetGroup (GetGroupReq) returns (GetGroupResp);
  33. // 获取用户加入的所有群组
  34. rpc GetGroups (Empty) returns (GetGroupsResp);
  35. // 添加群组成员
  36. rpc AddGroupMembers (AddGroupMembersReq) returns (AddGroupMembersResp);
  37. // 更新群组成员信息
  38. rpc UpdateGroupMember (UpdateGroupMemberReq) returns (Empty);
  39. // 删除群组成员
  40. rpc DeleteGroupMember (DeleteGroupMemberReq) returns (Empty);
  41. // 获取群组成员
  42. rpc GetGroupMembers (GetGroupMembersReq) returns (GetGroupMembersResp);
  43. // 设置禁言
  44. rpc SetGroupBannedMembers (SetGroupMemberBannedReq) returns (SetGroupMemberBannedResp);
  45. // 取消禁言
  46. rpc SetGroupRemoveBannedMembers (SetGroupMemberRemoveBannedReq) returns (Empty);
  47. // 获取群组禁言成员
  48. rpc GetGroupBannedMembers (GetGroupBannedMembersReq) returns (GetGroupBannedMembersResp);
  49. }
  50. message RegisterDeviceReq {
  51. int32 type = 2; // 设备类型
  52. string brand = 3; // 厂商
  53. string model = 4; // 机型
  54. string system_version = 5; // 系统版本
  55. string sdk_version = 6; // sdk版本号
  56. }
  57. message RegisterDeviceResp {
  58. int64 device_id = 1; // 设备id
  59. }
  60. message SendMessageReq {
  61. ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
  62. int64 receiver_id = 2; // 用户id或者群组id
  63. repeated int64 to_user_ids = 3; // 需要@的用户id列表
  64. MessageType message_type = 4; // 消息类型
  65. bytes message_content = 5; // 消息内容
  66. int64 send_time = 6; // 消息发送时间戳,精确到毫秒
  67. bool is_persist = 7; // 是否将消息持久化到数据库
  68. string message_content_back = 8;
  69. }
  70. message SendMessageResp {
  71. int64 seq = 1; // 消息序列号
  72. }
  73. message RecallMessageReq {
  74. ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
  75. int64 receiver_id = 2; // 用户id或者群组id
  76. repeated int64 to_user_ids = 3; // 需要@的用户id列表
  77. MessageType message_type = 4; // 消息类型
  78. bytes message_content = 5; // 消息内容
  79. int64 send_time = 6; // 消息发送时间戳,精确到毫秒
  80. bool is_persist = 7; // 是否将消息持久化到数据库
  81. string message_content_back = 8;
  82. }
  83. message RecallMessageResp {
  84. int64 seq = 1; // 消息序列号
  85. }
  86. message SendRedPacketReq {
  87. ReceiverType receiver_type = 1; // 接收者类型,1:user;2:group
  88. int64 receiver_id = 2; // 用户id或者群组id
  89. MessageType message_type = 3; // 消息类型
  90. bytes message_content = 4; // 消息内容
  91. int64 send_time = 5; // 消息发送时间戳,精确到毫秒
  92. repeated int64 to_user_ids = 6; // 红包给到哪些用户(专属红包)
  93. string message_content_back = 7;
  94. }
  95. message SendRedPacketResp {
  96. int64 seq = 1; // 消息序列号
  97. }
  98. message PushRoomReq{
  99. int64 room_id = 1; // 房间id
  100. MessageType message_type = 2; // 消息类型
  101. bytes message_content = 3; // 消息内容
  102. int64 send_time = 4; // 消息发送时间戳,精确到毫秒
  103. bool is_persist = 5; // 是否将消息持久化
  104. bool is_priority = 6; // 是否优先推送
  105. }
  106. message AddFriendReq {
  107. int64 friend_id = 1; // 用户id
  108. string remarks = 2; // 备注
  109. string description = 3; // 描述
  110. }
  111. message DeleteFriendReq {
  112. int64 user_id = 1; // 用户id
  113. }
  114. message AgreeAddFriendReq {
  115. int64 user_id = 1; // 用户id
  116. string remarks = 2; // 备注
  117. }
  118. message SetFriendReq {
  119. int64 friend_id = 1; // 好友id
  120. string remarks = 2; // 备注
  121. string extra = 8; // 附加字段
  122. }
  123. message SetFriendResp {
  124. int64 friend_id = 1; // 好友id
  125. string remarks = 2; // 备注
  126. string extra = 8; // 附加字段
  127. }
  128. message Friend {
  129. int64 user_id = 1; // 用户id
  130. string phone_number = 2; // 电话号码
  131. string nickname = 3; // 昵称
  132. int32 sex = 4; // 性别
  133. string avatar_url = 5; // 头像地址
  134. string user_extra = 6; // 用户附加字段
  135. string remarks = 7; // 备注
  136. string extra = 8; // 附加字段
  137. }
  138. message GetFriendsResp {
  139. repeated Friend friends = 1;
  140. }
  141. message CreateGroupReq {
  142. string name = 1; // 名称
  143. string avatar_url = 2; // 头像
  144. string introduction = 3; // 简介
  145. string extra = 4; // 附加字段
  146. repeated int64 member_ids = 5; // 群组成员ID列表
  147. }
  148. message CreateGroupResp {
  149. int64 group_id = 1; // 群组id
  150. }
  151. message UpdateGroupReq {
  152. int64 group_id = 1; // 群组id
  153. string avatar_url = 2; // 头像
  154. string name = 3; // 名称
  155. string introduction = 4; // 简介
  156. string extra = 5; // 附加字段
  157. }
  158. message GetGroupReq {
  159. int64 group_id = 1;
  160. }
  161. message GetGroupResp {
  162. Group group = 1;
  163. MemberType member_type = 2;
  164. GroupUserStatusType group_user_status_type = 3;
  165. }
  166. message Group {
  167. int64 group_id = 1; // 群组id
  168. string name = 2; // 名称
  169. string avatar_url = 3; // 头像
  170. string introduction = 4; // 简介
  171. int32 user_mum = 5; // 用户数
  172. int32 is_all_member_banned = 6; // 是否全员禁言(1:是 2:否)
  173. string extra = 7; // 附加字段
  174. int64 create_time = 8; // 创建时间
  175. int64 update_time = 9; // 更新时间
  176. }
  177. message GetGroupsResp {
  178. repeated Group groups = 1;
  179. }
  180. message AddGroupMembersReq {
  181. int64 group_id = 1; // 群组id
  182. repeated int64 user_ids = 2; // 用户id列表
  183. }
  184. message AddGroupMembersResp {
  185. repeated int64 user_ids = 1; // 已经在群组的用户id列表
  186. }
  187. enum MemberType {
  188. GMT_UNKNOWN = 0; // 未知
  189. GMT_ADMIN = 1; // 群主
  190. GMT_MEMBER = 2; // 成员
  191. GMT_MANAGE = 3; // 管理员
  192. }
  193. message UpdateGroupMemberReq {
  194. int64 group_id = 1; // 群组id
  195. int64 user_id = 2; // 用户id
  196. MemberType member_type = 3; // 成员类型
  197. string remarks = 4; // 备注
  198. string extra = 5; // 附加字段
  199. }
  200. message DeleteGroupMemberReq {
  201. int64 group_id = 1; // 群组id
  202. int64 user_id = 2; // 用户id
  203. }
  204. message GetGroupMembersReq {
  205. int64 group_id = 1;
  206. int64 limit = 2;
  207. }
  208. message GetGroupMembersResp {
  209. repeated GroupMember members = 1;
  210. }
  211. message GroupMember {
  212. int64 user_id = 1;
  213. string nickname = 2; // 昵称
  214. int32 sex = 3; // 性别
  215. string avatar_url = 4; // 头像地址
  216. string user_extra = 5; // 用户附加字段
  217. MemberType member_type = 6; // 成员类型
  218. string remarks = 7; // 备注
  219. string extra = 8; // 群组成员附加字段
  220. int32 status = 9; // 状态
  221. }
  222. message SetGroupMemberBannedReq {
  223. int64 group_id = 1; // 群组id
  224. repeated int64 user_ids = 2; // 用户id列表
  225. AllMemberBannedType is_all_member_banned = 3; // 全员禁言(1:是 2:否)
  226. }
  227. message SetGroupMemberRemoveBannedReq {
  228. int64 group_id = 1; // 群组id
  229. repeated int64 remove_user_ids = 2; // 解除用户id列表
  230. }
  231. enum AllMemberBannedType {
  232. UNKNOWN_All_Member_Banned = 0; // 未知
  233. YES_All_Member_Banned = 1; // 是-全员禁言
  234. NOT_All_Member_Banned = 2; // 否-全员禁言
  235. }
  236. message SetGroupMemberBannedResp {
  237. AllMemberBannedType is_all_member_banned = 3; // 全员禁言(1:是 2:否)
  238. repeated GroupMember members = 1; //禁言人员列表
  239. }
  240. message GetGroupBannedMembersReq {
  241. int64 group_id = 1;
  242. }
  243. message GetGroupBannedMembersResp {
  244. repeated GroupMember members = 1;
  245. }