chat.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. message PartnerFindRoomListRequest {
  30. int64 nextId = 1;
  31. int64 offset = 2;
  32. string IdentifyId = 3;
  33. bool isFindNotReply = 4; // 是否查询没回复过的内容
  34. bool isWithinSevenDay = 5; // 是否在七日内
  35. }
  36. message UserFindRoomListRequest {
  37. int64 nextId = 1;
  38. int64 offset = 2;
  39. string IdentifyId = 3;
  40. bool isWithinSevenDay = 4; // 是否在七日内
  41. }
  42. message UserFindRoomListReply{
  43. repeated UserRoomInfo list = 1;
  44. int64 nextId = 2;
  45. }
  46. message UserRoomInfo{
  47. string personType = 1;// 用户类型
  48. string personId = 2;// 用户ID
  49. int64 unreadNum = 3;// 用户未读数
  50. string lastContent = 4;// 上次发送内容
  51. int64 lastTime = 5;// 上次发送时间
  52. int64 likeability = 6;// 好感度
  53. int64 roomId = 7; // 房间ID
  54. }
  55. message PartnerFindRoomListReply{
  56. repeated PartnerRoomInfo list = 1;
  57. int64 nextId = 2;
  58. }
  59. message PartnerRoomInfo{
  60. int64 personSendNum = 1;// 用户发送数
  61. string personId = 2;// 用户ID
  62. int64 unreadNum = 3;// 接待者未读数
  63. string lastContent = 4;// 上次发送内容
  64. int64 lastTime = 5;// 上次发送时间
  65. int64 benefit = 6;// 收益
  66. string type = 7;// 类型(新客:new,付费:pay)
  67. int64 sex = 8;// 性别
  68. string avatarUrl = 9;// 头像
  69. string nickname = 10;// 昵称
  70. int64 age = 11;// 年龄
  71. int64 likeability = 12;// 好感度
  72. int64 roomId = 13;// 房间号ID
  73. }
  74. message CreateChatRoomParam {
  75. string personId1 = 1;
  76. string personIdentifyID1 = 2; // 身份ID
  77. string personType1 = 3; // 类型
  78. string personId2 = 4;
  79. string personIdentifyID2 = 5; // 身份ID
  80. string personType2 = 6; // 类型
  81. }
  82. message SetBlackChatParam {
  83. string personIdentifyId = 1; // 拉黑者的身份ID
  84. int64 roomId = 2; // 房间ID
  85. }
  86. message ReceiveRequest{
  87. string method = 1;
  88. bytes data = 2;
  89. string id = 3;
  90. string websocketTag = 4;
  91. string personType = 5;
  92. string personId = 6;
  93. }
  94. message ReceiveReply{
  95. }
  96. message CheckUserPartnerIsRelationshipReply{
  97. bool isBuildRelationship = 1;
  98. int64 roomId = 2;
  99. }
  100. message RoomReply{
  101. int64 roomId = 1;
  102. }
  103. message FindChatRoomMsgRequest{
  104. int64 roomId = 1;
  105. string personType = 2; // 类型
  106. string personID = 3; // 查询目标的ID
  107. }
  108. message FindChatRecordListRequest{
  109. int64 nextId = 1;
  110. int64 offset = 2;
  111. int64 roomId = 3;
  112. string personType = 4; // 类型
  113. string personID = 5; // 查询目标的ID
  114. }