chat.proto 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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.UserAndPartnerIdentifyIdParam) 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. rpc Receive (ReceiveRequest) returns (ReceiveReply){};
  24. // 查询聊天记录
  25. rpc FindChatRecordList (FindChatRecordListRequest) returns (common.ChatRecordListReply){};
  26. // 房间信息
  27. rpc FindChatRoomMsg (FindChatRoomMsgRequest) returns (common.ChatRoomMsg){};
  28. // 拉黑
  29. rpc SetBlackChat (SetBlackChatParam) returns (google.protobuf.Empty){};
  30. // 删除房间
  31. rpc DeleteChat (SetBlackChatParam) returns (google.protobuf.Empty){};
  32. // 拉黑
  33. rpc Report (common.ReportRequest) returns (google.protobuf.Empty){};
  34. // 接待员领取开通奖励
  35. rpc PartnerGetAward (PartnerGetAwardRequest) returns (google.protobuf.Empty){};
  36. // 房间信息
  37. rpc FindRoomCardMsg (FindRoomCardMsgRequest) returns (common.RoomChatMsg){};
  38. // 查询未处理的数据
  39. rpc FindNotReplyNum (common.IdentifyIdRequest) returns (FindNotReplyNumReply){};
  40. // 创建纸条
  41. rpc CreateScrip (common.CreateScripRequest) returns (common.ScripID){};
  42. // 删除纸条
  43. rpc DeleteScrip (common.DeleteScripRequest) returns (google.protobuf.Empty){};
  44. // 查询自己的小纸条
  45. rpc FindMyScrip (common.FindScripRequest) returns (common.ScripReply){};
  46. // 查询别人的小纸条
  47. rpc FindOtherScrip (common.FindOtherScripRequest) returns (common.ScripReply){};
  48. // 查询随机纸条列表
  49. rpc FindRecommendScrip (common.FindScripRequest) returns (common.ScripReply){};
  50. // 用户查看纸条
  51. rpc PersonLookScrip (common.PersonLookScripRequest) returns (google.protobuf.Empty){};
  52. // 用户点击回看
  53. rpc PersonClickLookBack (common.PersonParam) returns (common.ScripInfo){};
  54. // 回复小纸条
  55. rpc PersonReplyScrip (common.ReplyScripRequest) returns (common.ChatRecordInfo){};
  56. // 获取假弹窗
  57. rpc GetWindowInfo (common.MatchingRequest) returns (chat.WindowInfo){};
  58. // 随机匹配
  59. rpc GetRandomMatching (common.MatchingRequest) returns (GetRandomMatchingReply){};
  60. // 随机匹配接待员
  61. rpc GetMatchingPartnerInfo (GetMatchingPartnerInfoRequest) returns (common.GetMatchingPartnerInfoReply){};
  62. // 接待员收藏某条记录
  63. rpc PartnerCollect (PartnerCollectIDsRequest) returns (google.protobuf.Empty){};
  64. // 接待员取消收藏某条记录
  65. rpc PartnerDeleteCollect (PartnerCollectRequest) returns (google.protobuf.Empty){};
  66. // 查询接待员在本房间的收藏列表
  67. rpc FindChatCollectList (FindChatRecordListRequest) returns (common.ChatRecordListReply){};
  68. // 用户解锁语音
  69. rpc UserUnlockVoice (UserUnlockRequest) returns (google.protobuf.Empty){};
  70. // 用户解锁图片
  71. rpc UserUnlockPicture (UserUnlockRequest) returns (google.protobuf.Empty){};
  72. // 获取房间的接待员收益
  73. rpc GetRoomProfit (common.RoomIDRequest) returns (GetRoomProfitReply){};
  74. // 获取在线人数
  75. rpc GetOnlinePersonNum (google.protobuf.Empty) returns (GetOnlinePersonNumReply){};
  76. // 查询用户全部的未读数
  77. rpc FindUserAllUnreadNum (common.IdentifyIdRequest) returns (UnreadNumReply){};
  78. // 查询接待员全部的未读数
  79. rpc FindPartnerAllUnreadNum (common.IdentifyIdRequest) returns (UnreadNumReply){};
  80. // 用户查询与某人的房间
  81. rpc GetUserRoomByPerson (common.IdentifyIDsParam) returns (UserRoomInfo){};
  82. // 接待员查询与某人的房间
  83. rpc GetPartnerRoomByPerson (common.IdentifyIDsParam) returns (PartnerRoomInfo){};
  84. // 管理员查询房间列表
  85. rpc ManagerFindRoomList (common.ManagerFindRoomListRequest) returns (common.ManagerFindRoomListReply){};
  86. }
  87. message GetOnlinePersonNumReply{
  88. int64 num = 1;
  89. }
  90. message GetMatchingPartnerInfoRequest{
  91. int64 sex = 1;// 性别
  92. string userID = 2; // 用户ID
  93. string identifyId = 3;// 身份ID
  94. string openId = 4;
  95. string appId = 5;
  96. }
  97. message GetRoomProfitReply{
  98. int64 roomProfit = 1;// 房间收益
  99. }
  100. message UserUnlockRequest{
  101. int64 roomId = 1;// 房间ID
  102. string personId = 2;
  103. string personType = 3;
  104. string identifyId = 4;
  105. }
  106. message PartnerCollectIDsRequest{
  107. repeated int64 chatRecordIds = 1;// 记录ID
  108. string personId = 2;
  109. string personType = 3;
  110. string identifyId = 4;
  111. int64 roomId = 5;// 房间ID
  112. }
  113. message PartnerCollectRequest{
  114. int64 chatRecordId = 1;// 记录ID
  115. string personId = 2;
  116. string personType = 3;
  117. string identifyId = 4;
  118. }
  119. message GetRandomMatchingReply{
  120. string personID = 1; // 查询目标的ID
  121. string personType = 2; // 类型
  122. int64 roomId = 3; // 房间ID
  123. string nickname = 4;// 昵称
  124. string avatarUrl = 5;// 头像
  125. int64 sex = 6;// 性别
  126. int64 age = 7;// 年龄
  127. }
  128. message FindNotReplyNumReply{
  129. int64 personNum = 1;// 未接待人数
  130. int64 messageNum = 2;// 消息数
  131. }
  132. message UnreadNumReply{
  133. int64 unreadNum = 1;// 未读数
  134. }
  135. message FindRecommendPersonListRequest{
  136. int64 num = 1;// 推荐数
  137. bool isRefresh = 2; // 是否刷新
  138. string personID = 3; // 查询目标的ID
  139. string personType = 4; // 类型
  140. string identifyId = 5;// 身份ID
  141. }
  142. message FindRoomCardMsgRequest{
  143. string userIdentifyId = 1; // 身份ID
  144. string partnerIdentifyId = 2; // 身份ID
  145. }
  146. message PartnerGetAwardReply {
  147. int64 balance = 1;
  148. }
  149. message PartnerGetAwardRequest{
  150. string userIdentifyId = 1; // 身份ID
  151. string partnerIdentifyId = 2; // 身份ID
  152. string awardType = 3;
  153. string partnerId = 4;
  154. }
  155. message PartnerFindRoomListRequest {
  156. int64 nextId = 1;
  157. int64 offset = 2;
  158. string IdentifyId = 3;
  159. bool isFindNotReply = 4; // 是否查询没回复过的内容
  160. bool isWithinSevenDay = 5; // 是否在七日内
  161. }
  162. message UserFindRoomListRequest {
  163. int64 nextId = 1;
  164. int64 offset = 2;
  165. string IdentifyId = 3;
  166. bool isWithinSevenDay = 4; // 是否在七日内
  167. }
  168. message UserFindRoomListReply{
  169. repeated UserRoomInfo list = 1;
  170. int64 nextId = 2;
  171. }
  172. message UserRoomInfo{
  173. string personType = 1;// 用户类型
  174. string personId = 2;// 用户ID
  175. int64 unreadNum = 3;// 用户未读数
  176. string lastContent = 4;// 上次发送内容
  177. int64 lastTime = 5;// 上次发送时间
  178. int64 likeability = 6;// 好感度
  179. int64 roomId = 7; // 房间ID
  180. }
  181. message PartnerFindRoomListReply{
  182. repeated PartnerRoomInfo list = 1;
  183. int64 nextId = 2;
  184. }
  185. message PartnerRoomInfo{
  186. int64 personSendNum = 1;// 用户发送数
  187. string personId = 2;// 用户ID
  188. int64 unreadNum = 3;// 接待者未读数
  189. string lastContent = 4;// 上次发送内容
  190. int64 lastTime = 5;// 上次发送时间
  191. int64 benefit = 6;// 收益
  192. string type = 7;// 类型(新客:new,付费:pay)
  193. int64 sex = 8;// 性别
  194. string avatarUrl = 9;// 头像
  195. string nickname = 10;// 昵称
  196. int64 age = 11;// 年龄
  197. int64 likeability = 12;// 好感度
  198. int64 roomId = 13;// 房间号ID
  199. int64 personSendBaseNum = 14;// 用户发送基数
  200. }
  201. message CreateChatRoomParam {
  202. string personId1 = 1;
  203. string personIdentifyID1 = 2; // 身份ID
  204. string personType1 = 3; // 类型
  205. string personId2 = 4;
  206. string personIdentifyID2 = 5; // 身份ID
  207. string personType2 = 6; // 类型
  208. string source = 7;// 来源
  209. }
  210. message SetBlackChatParam {
  211. string personIdentifyId = 1; // 拉黑者的身份ID
  212. int64 roomId = 2; // 房间ID
  213. }
  214. message ReceiveRequest{
  215. string method = 1;
  216. bytes data = 2;
  217. string id = 3;
  218. string websocketTag = 4;
  219. string personType = 5;
  220. string personId = 6;
  221. }
  222. message ReceiveReply{
  223. }
  224. message CheckUserPartnerIsRelationshipReply{
  225. bool isBuildRelationship = 1;
  226. int64 roomId = 2;
  227. }
  228. message RoomReply{
  229. int64 roomId = 1;
  230. }
  231. message FindChatRoomMsgRequest{
  232. int64 roomId = 1;
  233. string personType = 2; // 类型
  234. string personID = 3; // 查询目标的ID
  235. }
  236. message FindChatRecordListRequest{
  237. int64 nextId = 1;
  238. int64 offset = 2;
  239. int64 roomId = 3;
  240. string personType = 4; // 类型
  241. string personID = 5; // 查询目标的ID
  242. }
  243. message WindowInfo{
  244. string content = 1; // 文本内容
  245. int64 roomId = 2; // 房间ID
  246. string avatarUrl = 3;// 头像
  247. string nickname = 4;// 昵称
  248. int64 age = 5;// 年龄
  249. int64 sex = 6;// 性别
  250. repeated string reply = 7;// 快捷回复
  251. }
  252. message ReminderInfo{
  253. int64 num = 1;// 发送条数
  254. int64 limitNum = 2;// 上限条数
  255. int64 sendTime = 3;// 发送时间
  256. int64 roomId = 4;// 房间ID
  257. }
  258. message ReminderUserInfo{
  259. int64 roomId = 1;// 房间ID
  260. }
  261. message UpLikeabilityInfo{
  262. int64 likeability = 1;// 好感度
  263. int64 roomId = 2;// 房间ID
  264. }