chat.proto 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. syntax = "proto3";
  2. package api.chat;
  3. //import "google/api/annotations.proto";
  4. //import "google/protobuf/struct.proto";
  5. import "google/protobuf/empty.proto";
  6. import "api/common/common.proto";
  7. option go_package = "git.ikuban.com/server/pw-protobuf/api/chat;chat";
  8. option java_multiple_files = true;
  9. option java_package = "api.chat";
  10. service Chat {
  11. // 检查用户是否与接待员聊天
  12. rpc CheckUserPartnerIsRelationship (common.UserIDsParam) returns (CheckUserPartnerIsRelationshipReply);
  13. // 创建聊天房间
  14. rpc CreateChatRoom (CreateChatRoomParam) returns (RoomReply);
  15. // 查询在线人的列表
  16. rpc FindOnlinePersonList (common.ListPageAndPersonRequest) returns (common.RecommendPersonListReply);
  17. // 查询推荐人的列表
  18. rpc FindRecommendPersonList (FindRecommendPersonListRequest) returns (common.RecommendPersonListReply);
  19. // 接待员查询房间列表
  20. rpc PartnerFindRoomList (PartnerFindRoomListRequest) returns (PartnerFindRoomListReply){};
  21. // 用户查询房间列表
  22. rpc UserFindRoomList (UserFindRoomListRequest) returns (UserFindRoomListReply){};
  23. // websocket调用
  24. rpc Receive (ReceiveRequest) returns (ReceiveReply){};
  25. // 查询聊天记录
  26. rpc FindChatRecordList (FindChatRecordListRequest) returns (common.ChatRecordListReply){};
  27. // 房间信息
  28. rpc FindChatRoomMsg (FindChatRoomMsgRequest) returns (common.ChatRoomMsg){};
  29. // 拉黑
  30. rpc SetBlackChat (SetBlackChatParam) returns (google.protobuf.Empty){};
  31. // 删除房间
  32. rpc DeleteChat (SetBlackChatParam) returns (google.protobuf.Empty){};
  33. // 拉黑
  34. rpc Report (common.ReportRequest) returns (google.protobuf.Empty){};
  35. // 房间信息
  36. rpc FindRoomCardMsg (FindRoomCardMsgRequest) returns (common.RoomChatMsg){};
  37. // 创建纸条
  38. rpc CreateScrip (common.CreateScripRequest) returns (common.ScripID){};
  39. // 删除纸条
  40. rpc DeleteScrip (common.DeleteScripRequest) returns (google.protobuf.Empty){};
  41. // 查询自己的小纸条
  42. rpc FindMyScrip (common.FindScripRequest) returns (common.ScripReply){};
  43. // 查询别人的小纸条
  44. rpc FindOtherScrip (common.FindOtherScripRequest) returns (common.ScripReply){};
  45. // 查询随机纸条列表
  46. rpc FindRecommendScrip (common.FindScripRequest) returns (common.ScripReply){};
  47. // 用户查看纸条
  48. rpc PersonLookScrip (common.PersonLookScripRequest) returns (google.protobuf.Empty){};
  49. // 用户点击回看
  50. rpc PersonClickLookBack (common.PersonParam) returns (common.ScripInfo){};
  51. // 回复小纸条
  52. rpc PersonReplyScrip (common.ReplyScripRequest) returns (common.ChatRecordInfo){};
  53. // 获取假弹窗
  54. rpc GetWindowInfo (common.MatchingRequest) returns (chat.WindowInfo){};
  55. // 随机匹配
  56. rpc GetRandomMatching (common.MatchingRequest) returns (GetRandomMatchingReply){};
  57. // 随机匹配接待员
  58. rpc GetMatchingPartnerInfo (GetMatchingPartnerInfoRequest) returns (common.GetMatchingPartnerInfoReply){};
  59. // 精确匹配用户
  60. rpc AccurateMatchingUserInfo (AccurateMatchingUserInfoRequest) returns (common.GetMatchingPartnerInfoReply){};
  61. // 接待员收藏某条记录
  62. rpc PartnerCollect (PartnerCollectIDsRequest) returns (google.protobuf.Empty){};
  63. // 接待员取消收藏某条记录
  64. rpc PartnerDeleteCollect (PartnerCollectRequest) returns (google.protobuf.Empty){};
  65. // 查询接待员在本房间的收藏列表
  66. rpc FindChatCollectList (FindChatRecordListRequest) returns (common.ChatRecordListReply){};
  67. // 用户解锁语音
  68. rpc UserUnlockVoice (UserUnlockRequest) returns (google.protobuf.Empty){};
  69. // 用户解锁图片
  70. rpc UserUnlockPicture (UserUnlockRequest) returns (google.protobuf.Empty){};
  71. // 获取房间的接待员收益
  72. rpc GetRoomProfit (common.RoomIDRequest) returns (GetRoomProfitReply){};
  73. // 获取在线人数
  74. rpc GetOnlinePersonNum (google.protobuf.Empty) returns (GetOnlinePersonNumReply){};
  75. // 查询用户全部的未读数
  76. rpc FindUserAllUnreadNum (common.PersonIDParam) returns (UnreadNumReply){};
  77. // 用户查询与某人的房间
  78. rpc GetUserRoomByPerson (common.UserIDsParam) returns (UserRoomInfo){};
  79. // 用户查询对某人是否是超级喜欢
  80. rpc GetSuperLoveByPerson (common.UserIDsParam) returns (UserSuperLoveInfo){};
  81. // 管理员查询房间列表
  82. rpc ManagerFindRoomList (common.ManagerFindRoomListRequest) returns (common.ManagerFindRoomListReply){};
  83. // 管理员查询聊天记录
  84. rpc ManagerFindChatRecordList (common.ManagerFindChatRecordListRequest) returns (common.ChatRecordListReply){};
  85. // 管理员查询举报列表
  86. rpc ManagerFindReportList (common.ManagerFindReportListRequest) returns (common.ManagerFindReportListReply){};
  87. // 管理员查询某个举报者的举报详情列表
  88. rpc ManagerFindReportDetailsList (common.ManagerFindReportDetailsListRequest) returns (common.ManagerFindReportDetailsListReply){};
  89. // 发送消息
  90. rpc SendMessage (SendMessageRequest) returns (common.SendMessageReply){};
  91. }
  92. message SendMessageRequest{
  93. int64 roomId = 1;// 房间ID
  94. common.Message message = 2;// 消息
  95. string msgType = 3;// 消息类型
  96. string personId = 4;// 发送人的ID
  97. string websocketTag = 5;
  98. bool isMiniProgram = 6;
  99. string appId = 7;
  100. string openId = 8;
  101. }
  102. message GetOnlinePersonNumReply{
  103. int64 num = 1;
  104. }
  105. message GetMatchingPartnerInfoRequest{
  106. int64 sex = 1;// 性别
  107. string userID = 2; // 用户ID
  108. string openId = 4;
  109. string appId = 5;
  110. }
  111. message AccurateMatchingUserInfoRequest{
  112. int64 sex = 1;// 性别
  113. string userID = 2; // 用户ID
  114. string openId = 4;
  115. string appId = 5;
  116. string province = 7;// 省
  117. string city = 8;// 市
  118. int64 maxAge = 9;// 最大年龄
  119. int64 minAge = 10;// 最小年龄
  120. }
  121. message GetRoomProfitReply{
  122. int64 roomProfit = 1;// 房间收益
  123. }
  124. message UserUnlockRequest{
  125. int64 roomId = 1;// 房间ID
  126. string personId = 2;
  127. }
  128. message PartnerCollectIDsRequest{
  129. repeated int64 chatRecordIds = 1;// 记录ID
  130. string personId = 2;
  131. int64 roomId = 5;// 房间ID
  132. }
  133. message PartnerCollectRequest{
  134. int64 chatRecordId = 1;// 记录ID
  135. string personId = 2;
  136. string identifyId = 4;
  137. }
  138. message GetRandomMatchingReply{
  139. string personID = 1; // 查询目标的ID
  140. int64 roomId = 3; // 房间ID
  141. string nickname = 4;// 昵称
  142. string avatarUrl = 5;// 头像
  143. int64 sex = 6;// 性别
  144. int64 age = 7;// 年龄
  145. }
  146. message FindNotReplyNumReply{
  147. int64 personNum = 1;// 未接待人数
  148. int64 messageNum = 2;// 消息数
  149. }
  150. message UnreadNumReply{
  151. int64 unreadNum = 1;// 未读数
  152. }
  153. message FindRecommendPersonListRequest{
  154. int64 num = 1;// 推荐数
  155. bool isRefresh = 2; // 是否刷新
  156. string personID = 3; // 查询目标的ID
  157. }
  158. message FindRoomCardMsgRequest{
  159. string userId = 1; // 身份ID
  160. string partnerId = 2; // 身份ID
  161. }
  162. message PartnerGetAwardReply {
  163. int64 balance = 1;
  164. }
  165. message PartnerFindRoomListRequest {
  166. int64 nextId = 1;
  167. int64 offset = 2;
  168. string personId = 3;
  169. bool isFindNotReply = 4; // 是否查询没回复过的内容
  170. bool isWithinSevenDay = 5; // 是否在七日内
  171. }
  172. message UserFindRoomListRequest {
  173. int64 nextId = 1;
  174. int64 offset = 2;
  175. string personId = 3;
  176. bool isWithinSevenDay = 4; // 是否在七日内
  177. bool isCloseFriend = 5; // 是否是密友
  178. }
  179. message UserFindRoomListReply{
  180. repeated UserRoomInfo list = 1;
  181. int64 nextId = 2;
  182. }
  183. message UserRoomInfo{
  184. string personId = 2;// 用户ID
  185. int64 unreadNum = 3;// 用户未读数
  186. string lastContent = 4;// 上次发送内容
  187. int64 lastTime = 5;// 上次发送时间
  188. int64 likeability = 6;// 好感度
  189. int64 roomId = 7; // 房间ID
  190. }
  191. message UserSuperLoveInfo{
  192. bool isSuperLove = 1;
  193. }
  194. message PartnerFindRoomListReply{
  195. repeated PartnerRoomInfo list = 1;
  196. int64 nextId = 2;
  197. }
  198. message PartnerRoomInfo{
  199. int64 personSendNum = 1;// 用户发送数
  200. string personId = 2;// 用户ID
  201. int64 unreadNum = 3;// 接待者未读数
  202. string lastContent = 4;// 上次发送内容
  203. int64 lastTime = 5;// 上次发送时间
  204. int64 benefit = 6;// 收益
  205. string type = 7;// 类型(新客:new,付费:pay)
  206. int64 sex = 8;// 性别
  207. string avatarUrl = 9;// 头像
  208. string nickname = 10;// 昵称
  209. int64 age = 11;// 年龄
  210. int64 likeability = 12;// 好感度
  211. int64 roomId = 13;// 房间号ID
  212. int64 personSendBaseNum = 14;// 用户发送基数
  213. }
  214. message CreateChatRoomParam {
  215. string personId1 = 1;
  216. string personId2 = 4;
  217. string source = 7;// 来源
  218. }
  219. message SetBlackChatParam {
  220. string personId = 1; // 拉黑者的身份ID
  221. int64 roomId = 2; // 房间ID
  222. }
  223. message ReceiveRequest{
  224. string method = 1;
  225. bytes data = 2;
  226. string id = 3;
  227. string websocketTag = 4;
  228. string personId = 6;
  229. }
  230. message ReceiveReply{
  231. }
  232. message CheckUserPartnerIsRelationshipReply{
  233. bool isBuildRelationship = 1;
  234. int64 roomId = 2;
  235. }
  236. message RoomReply{
  237. int64 roomId = 1;
  238. }
  239. message FindChatRoomMsgRequest{
  240. int64 roomId = 1;
  241. string personID = 3; // 查询目标的ID
  242. }
  243. message FindChatRecordListRequest{
  244. int64 nextId = 1;
  245. int64 offset = 2;
  246. int64 roomId = 3;
  247. string personID = 5; // 查询目标的ID
  248. }
  249. message WindowInfo{
  250. string content = 1; // 文本内容
  251. int64 roomId = 2; // 房间ID
  252. string avatarUrl = 3;// 头像
  253. string nickname = 4;// 昵称
  254. int64 age = 5;// 年龄
  255. int64 sex = 6;// 性别
  256. repeated string reply = 7;// 快捷回复
  257. bool isVip = 19;// 是否是Vip
  258. int64 vipLevel = 20;// vip等级
  259. bool isYearVip = 21;// 是否是年费Vip
  260. repeated string vipFunctions = 22;// vip功能
  261. }
  262. message ReminderInfo{
  263. int64 num = 1;// 发送条数
  264. int64 limitNum = 2;// 上限条数
  265. int64 sendTime = 3;// 发送时间
  266. int64 roomId = 4;// 房间ID
  267. }
  268. message ReminderUserInfo{
  269. int64 roomId = 1;// 房间ID
  270. }
  271. message UpLikeabilityInfo{
  272. int64 likeability = 1;// 好感度
  273. int64 roomId = 2;// 房间ID
  274. }