chat.proto 2.8 KB

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