chat.proto 7.1 KB

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