chat.proto 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. rpc Receive (ReceiveRequest) returns (ReceiveReply){};
  20. }
  21. message PartnerFindRoomListRequest {
  22. int64 nextId = 1;
  23. int64 offset = 2;
  24. string IdentifyId = 3;
  25. bool isFindNotReply = 4; // 是否查询没回复过的内容
  26. bool isWithinSevenDay = 5; // 是否在七日内
  27. }
  28. message PartnerFindRoomListReply{
  29. repeated PartnerRoomInfo list = 1;
  30. int64 nextId = 2;
  31. }
  32. message PartnerRoomInfo{
  33. int64 personSendNum = 1;// 用户发送数
  34. string personId = 2;// 用户ID
  35. int64 unreadNum = 3;// 接待者未读数
  36. string lastContent = 4;// 上次发送内容
  37. int64 lastTime = 5;// 上次发送时间
  38. }
  39. message CreateChatRoomParam {
  40. string personId1 = 1;
  41. string personIdentifyID1 = 2; // 身份ID
  42. string personType1 = 3; // 类型
  43. string personId2 = 4;
  44. string personIdentifyID2 = 5; // 身份ID
  45. string personType2 = 6; // 类型
  46. }
  47. message ReceiveRequest{
  48. string method = 1;
  49. bytes data = 2;
  50. string id = 3;
  51. string websocketTag = 4;
  52. string personType = 5;
  53. string personId = 6;
  54. }
  55. message ReceiveReply{
  56. }
  57. message CheckUserPartnerIsRelationshipReply{
  58. bool isBuildRelationship = 1;
  59. int64 roomId = 2;
  60. }
  61. message RoomReply{
  62. int64 roomId = 1;
  63. }