chat.proto 9.8 KB

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