chat.proto 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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 Report (common.ReportRequest) returns (google.protobuf.Empty){};
  32. // 接待员领取开通奖励
  33. rpc PartnerGetAward (PartnerGetAwardRequest) returns (PartnerGetAwardReply){};
  34. // 房间信息
  35. rpc FindRoomCardMsg (FindRoomCardMsgRequest) returns (common.RoomChatMsg){};
  36. // 查询未处理的数据
  37. rpc FindNotReplyNum (common.IdentifyIdRequest) returns (FindNotReplyNumReply){};
  38. }
  39. message FindNotReplyNumReply{
  40. int64 personNum = 1;// 未接待人数
  41. int64 messageNum = 2;// 消息数
  42. }
  43. message FindRecommendPersonListRequest{
  44. string nextId = 1;
  45. int64 offset = 2;
  46. string personID = 3; // 查询目标的ID
  47. string personType = 4; // 类型
  48. int64 sex = 5;// 性别(不筛选就是0)
  49. }
  50. message FindRoomCardMsgRequest{
  51. string userIdentifyId = 1; // 身份ID
  52. string partnerIdentifyId = 2; // 身份ID
  53. }
  54. message PartnerGetAwardReply {
  55. int64 balance = 1;
  56. }
  57. message PartnerGetAwardRequest{
  58. string userIdentifyId = 1; // 身份ID
  59. string partnerIdentifyId = 2; // 身份ID
  60. string awardType = 3;
  61. }
  62. message PartnerFindRoomListRequest {
  63. int64 nextId = 1;
  64. int64 offset = 2;
  65. string IdentifyId = 3;
  66. bool isFindNotReply = 4; // 是否查询没回复过的内容
  67. bool isWithinSevenDay = 5; // 是否在七日内
  68. }
  69. message UserFindRoomListRequest {
  70. int64 nextId = 1;
  71. int64 offset = 2;
  72. string IdentifyId = 3;
  73. bool isWithinSevenDay = 4; // 是否在七日内
  74. }
  75. message UserFindRoomListReply{
  76. repeated UserRoomInfo list = 1;
  77. int64 nextId = 2;
  78. }
  79. message UserRoomInfo{
  80. string personType = 1;// 用户类型
  81. string personId = 2;// 用户ID
  82. int64 unreadNum = 3;// 用户未读数
  83. string lastContent = 4;// 上次发送内容
  84. int64 lastTime = 5;// 上次发送时间
  85. int64 likeability = 6;// 好感度
  86. int64 roomId = 7; // 房间ID
  87. }
  88. message PartnerFindRoomListReply{
  89. repeated PartnerRoomInfo list = 1;
  90. int64 nextId = 2;
  91. }
  92. message PartnerRoomInfo{
  93. int64 personSendNum = 1;// 用户发送数
  94. string personId = 2;// 用户ID
  95. int64 unreadNum = 3;// 接待者未读数
  96. string lastContent = 4;// 上次发送内容
  97. int64 lastTime = 5;// 上次发送时间
  98. int64 benefit = 6;// 收益
  99. string type = 7;// 类型(新客:new,付费:pay)
  100. int64 sex = 8;// 性别
  101. string avatarUrl = 9;// 头像
  102. string nickname = 10;// 昵称
  103. int64 age = 11;// 年龄
  104. int64 likeability = 12;// 好感度
  105. int64 roomId = 13;// 房间号ID
  106. int64 personSendBaseNum = 14;// 用户发送基数
  107. }
  108. message CreateChatRoomParam {
  109. string personId1 = 1;
  110. string personIdentifyID1 = 2; // 身份ID
  111. string personType1 = 3; // 类型
  112. string personId2 = 4;
  113. string personIdentifyID2 = 5; // 身份ID
  114. string personType2 = 6; // 类型
  115. string source = 7;// 来源
  116. }
  117. message SetBlackChatParam {
  118. string personIdentifyId = 1; // 拉黑者的身份ID
  119. int64 roomId = 2; // 房间ID
  120. }
  121. message ReceiveRequest{
  122. string method = 1;
  123. bytes data = 2;
  124. string id = 3;
  125. string websocketTag = 4;
  126. string personType = 5;
  127. string personId = 6;
  128. }
  129. message ReceiveReply{
  130. }
  131. message CheckUserPartnerIsRelationshipReply{
  132. bool isBuildRelationship = 1;
  133. int64 roomId = 2;
  134. }
  135. message RoomReply{
  136. int64 roomId = 1;
  137. }
  138. message FindChatRoomMsgRequest{
  139. int64 roomId = 1;
  140. string personType = 2; // 类型
  141. string personID = 3; // 查询目标的ID
  142. }
  143. message FindChatRecordListRequest{
  144. int64 nextId = 1;
  145. int64 offset = 2;
  146. int64 roomId = 3;
  147. string personType = 4; // 类型
  148. string personID = 5; // 查询目标的ID
  149. }