chat.proto 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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 (PartnerGetAwardReply){};
  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 (common.SexReq) 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. message UserUnlockRequest{
  74. int64 roomId = 1;// 房间ID
  75. string personId = 2;
  76. string personType = 3;
  77. string identifyId = 4;
  78. }
  79. message PartnerCollectIDsRequest{
  80. repeated int64 chatRecordIds = 1;// 记录ID
  81. string personId = 2;
  82. string personType = 3;
  83. string identifyId = 4;
  84. int64 roomId = 5;// 房间ID
  85. }
  86. message PartnerCollectRequest{
  87. int64 chatRecordId = 1;// 记录ID
  88. string personId = 2;
  89. string personType = 3;
  90. string identifyId = 4;
  91. }
  92. message GetRandomMatchingReply{
  93. string personID = 1; // 查询目标的ID
  94. string personType = 2; // 类型
  95. int64 roomId = 3; // 房间ID
  96. string nickname = 4;// 昵称
  97. string avatarUrl = 5;// 头像
  98. int64 sex = 6;// 性别
  99. int64 age = 7;// 年龄
  100. }
  101. message FindNotReplyNumReply{
  102. int64 personNum = 1;// 未接待人数
  103. int64 messageNum = 2;// 消息数
  104. }
  105. message FindRecommendPersonListRequest{
  106. string nextId = 1;
  107. int64 offset = 2;
  108. string personID = 3; // 查询目标的ID
  109. string personType = 4; // 类型
  110. int64 sex = 5;// 性别(不筛选就是0)
  111. }
  112. message FindRoomCardMsgRequest{
  113. string userIdentifyId = 1; // 身份ID
  114. string partnerIdentifyId = 2; // 身份ID
  115. }
  116. message PartnerGetAwardReply {
  117. int64 balance = 1;
  118. }
  119. message PartnerGetAwardRequest{
  120. string userIdentifyId = 1; // 身份ID
  121. string partnerIdentifyId = 2; // 身份ID
  122. string awardType = 3;
  123. }
  124. message PartnerFindRoomListRequest {
  125. int64 nextId = 1;
  126. int64 offset = 2;
  127. string IdentifyId = 3;
  128. bool isFindNotReply = 4; // 是否查询没回复过的内容
  129. bool isWithinSevenDay = 5; // 是否在七日内
  130. }
  131. message UserFindRoomListRequest {
  132. int64 nextId = 1;
  133. int64 offset = 2;
  134. string IdentifyId = 3;
  135. bool isWithinSevenDay = 4; // 是否在七日内
  136. }
  137. message UserFindRoomListReply{
  138. repeated UserRoomInfo list = 1;
  139. int64 nextId = 2;
  140. }
  141. message UserRoomInfo{
  142. string personType = 1;// 用户类型
  143. string personId = 2;// 用户ID
  144. int64 unreadNum = 3;// 用户未读数
  145. string lastContent = 4;// 上次发送内容
  146. int64 lastTime = 5;// 上次发送时间
  147. int64 likeability = 6;// 好感度
  148. int64 roomId = 7; // 房间ID
  149. }
  150. message PartnerFindRoomListReply{
  151. repeated PartnerRoomInfo list = 1;
  152. int64 nextId = 2;
  153. }
  154. message PartnerRoomInfo{
  155. int64 personSendNum = 1;// 用户发送数
  156. string personId = 2;// 用户ID
  157. int64 unreadNum = 3;// 接待者未读数
  158. string lastContent = 4;// 上次发送内容
  159. int64 lastTime = 5;// 上次发送时间
  160. int64 benefit = 6;// 收益
  161. string type = 7;// 类型(新客:new,付费:pay)
  162. int64 sex = 8;// 性别
  163. string avatarUrl = 9;// 头像
  164. string nickname = 10;// 昵称
  165. int64 age = 11;// 年龄
  166. int64 likeability = 12;// 好感度
  167. int64 roomId = 13;// 房间号ID
  168. int64 personSendBaseNum = 14;// 用户发送基数
  169. }
  170. message CreateChatRoomParam {
  171. string personId1 = 1;
  172. string personIdentifyID1 = 2; // 身份ID
  173. string personType1 = 3; // 类型
  174. string personId2 = 4;
  175. string personIdentifyID2 = 5; // 身份ID
  176. string personType2 = 6; // 类型
  177. string source = 7;// 来源
  178. }
  179. message SetBlackChatParam {
  180. string personIdentifyId = 1; // 拉黑者的身份ID
  181. int64 roomId = 2; // 房间ID
  182. }
  183. message ReceiveRequest{
  184. string method = 1;
  185. bytes data = 2;
  186. string id = 3;
  187. string websocketTag = 4;
  188. string personType = 5;
  189. string personId = 6;
  190. }
  191. message ReceiveReply{
  192. }
  193. message CheckUserPartnerIsRelationshipReply{
  194. bool isBuildRelationship = 1;
  195. int64 roomId = 2;
  196. }
  197. message RoomReply{
  198. int64 roomId = 1;
  199. }
  200. message FindChatRoomMsgRequest{
  201. int64 roomId = 1;
  202. string personType = 2; // 类型
  203. string personID = 3; // 查询目标的ID
  204. }
  205. message FindChatRecordListRequest{
  206. int64 nextId = 1;
  207. int64 offset = 2;
  208. int64 roomId = 3;
  209. string personType = 4; // 类型
  210. string personID = 5; // 查询目标的ID
  211. }
  212. message WindowInfo{
  213. string content = 1; // 文本内容
  214. int64 roomId = 2; // 房间ID
  215. string avatarUrl = 3;// 头像
  216. string nickname = 4;// 昵称
  217. int64 age = 5;// 年龄
  218. int64 sex = 6;// 性别
  219. repeated string reply = 7;// 快捷回复
  220. }
  221. message ReminderInfo{
  222. int64 num = 1;// 发送条数
  223. int64 limitNum = 2;// 上限条数
  224. int64 sendTime = 3;// 发送时间
  225. int64 roomId = 4;// 房间ID
  226. }
  227. message ReminderUserInfo{
  228. int64 roomId = 1;// 房间ID
  229. }