chat.proto 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 FindRecommendScrip (common.FindScripRequest) returns (common.ScripReply){};
  48. // 用户查看纸条
  49. rpc PersonLookScrip (common.PersonLookScripRequest) returns (google.protobuf.Empty){};
  50. // 用户点击回看
  51. rpc PersonClickLookBack (common.PersonParam) returns (common.ScripInfo){};
  52. // 回复小纸条
  53. rpc PersonReplyScrip (common.ReplyScripRequest) returns (common.ChatRecordInfo){};
  54. // 获取假弹窗
  55. rpc GetWindowInfo (GetWindowInfoRequest) returns (chat.WindowInfo){};
  56. }
  57. message GetWindowInfoRequest{
  58. string personId = 1; // 查询目标的ID
  59. string personType = 2; // 类型
  60. string identifyId = 3; // 身份ID
  61. }
  62. message FindNotReplyNumReply{
  63. int64 personNum = 1;// 未接待人数
  64. int64 messageNum = 2;// 消息数
  65. }
  66. message FindRecommendPersonListRequest{
  67. string nextId = 1;
  68. int64 offset = 2;
  69. string personID = 3; // 查询目标的ID
  70. string personType = 4; // 类型
  71. int64 sex = 5;// 性别(不筛选就是0)
  72. }
  73. message FindRoomCardMsgRequest{
  74. string userIdentifyId = 1; // 身份ID
  75. string partnerIdentifyId = 2; // 身份ID
  76. }
  77. message PartnerGetAwardReply {
  78. int64 balance = 1;
  79. }
  80. message PartnerGetAwardRequest{
  81. string userIdentifyId = 1; // 身份ID
  82. string partnerIdentifyId = 2; // 身份ID
  83. string awardType = 3;
  84. }
  85. message PartnerFindRoomListRequest {
  86. int64 nextId = 1;
  87. int64 offset = 2;
  88. string IdentifyId = 3;
  89. bool isFindNotReply = 4; // 是否查询没回复过的内容
  90. bool isWithinSevenDay = 5; // 是否在七日内
  91. }
  92. message UserFindRoomListRequest {
  93. int64 nextId = 1;
  94. int64 offset = 2;
  95. string IdentifyId = 3;
  96. bool isWithinSevenDay = 4; // 是否在七日内
  97. }
  98. message UserFindRoomListReply{
  99. repeated UserRoomInfo list = 1;
  100. int64 nextId = 2;
  101. }
  102. message UserRoomInfo{
  103. string personType = 1;// 用户类型
  104. string personId = 2;// 用户ID
  105. int64 unreadNum = 3;// 用户未读数
  106. string lastContent = 4;// 上次发送内容
  107. int64 lastTime = 5;// 上次发送时间
  108. int64 likeability = 6;// 好感度
  109. int64 roomId = 7; // 房间ID
  110. }
  111. message PartnerFindRoomListReply{
  112. repeated PartnerRoomInfo list = 1;
  113. int64 nextId = 2;
  114. }
  115. message PartnerRoomInfo{
  116. int64 personSendNum = 1;// 用户发送数
  117. string personId = 2;// 用户ID
  118. int64 unreadNum = 3;// 接待者未读数
  119. string lastContent = 4;// 上次发送内容
  120. int64 lastTime = 5;// 上次发送时间
  121. int64 benefit = 6;// 收益
  122. string type = 7;// 类型(新客:new,付费:pay)
  123. int64 sex = 8;// 性别
  124. string avatarUrl = 9;// 头像
  125. string nickname = 10;// 昵称
  126. int64 age = 11;// 年龄
  127. int64 likeability = 12;// 好感度
  128. int64 roomId = 13;// 房间号ID
  129. int64 personSendBaseNum = 14;// 用户发送基数
  130. }
  131. message CreateChatRoomParam {
  132. string personId1 = 1;
  133. string personIdentifyID1 = 2; // 身份ID
  134. string personType1 = 3; // 类型
  135. string personId2 = 4;
  136. string personIdentifyID2 = 5; // 身份ID
  137. string personType2 = 6; // 类型
  138. string source = 7;// 来源
  139. }
  140. message SetBlackChatParam {
  141. string personIdentifyId = 1; // 拉黑者的身份ID
  142. int64 roomId = 2; // 房间ID
  143. }
  144. message ReceiveRequest{
  145. string method = 1;
  146. bytes data = 2;
  147. string id = 3;
  148. string websocketTag = 4;
  149. string personType = 5;
  150. string personId = 6;
  151. }
  152. message ReceiveReply{
  153. }
  154. message CheckUserPartnerIsRelationshipReply{
  155. bool isBuildRelationship = 1;
  156. int64 roomId = 2;
  157. }
  158. message RoomReply{
  159. int64 roomId = 1;
  160. }
  161. message FindChatRoomMsgRequest{
  162. int64 roomId = 1;
  163. string personType = 2; // 类型
  164. string personID = 3; // 查询目标的ID
  165. }
  166. message FindChatRecordListRequest{
  167. int64 nextId = 1;
  168. int64 offset = 2;
  169. int64 roomId = 3;
  170. string personType = 4; // 类型
  171. string personID = 5; // 查询目标的ID
  172. }
  173. message WindowInfo{
  174. string content = 1; // 文本内容
  175. int64 roomId = 2; // 房间ID
  176. string avatarUrl = 3;// 头像
  177. string nickname = 4;// 昵称
  178. int64 age = 5;// 年龄
  179. int64 sex = 6;// 性别
  180. repeated string reply = 7;// 快捷回复
  181. }