chat.proto 3.1 KB

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