chat.proto 4.3 KB

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