online.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. syntax = "proto3";
  2. package api.online;
  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/online;online";
  8. option java_multiple_files = true;
  9. option java_package = "api.online";
  10. service Online {
  11. // 用户上线
  12. rpc Receive (ReceiveRequest) returns (ReceiveReply){
  13. option (google.api.http) = {
  14. post: "/api/online/receive",
  15. body:"*"
  16. };
  17. };
  18. // 发送消息
  19. rpc SendMsg (SendMsgRequest) returns (SendMsgReply){};
  20. // 检查是否在线
  21. rpc CheckIsOnline (CheckIsOnlineRequest) returns (CheckIsOnlineReply){};
  22. // 检查是否在线
  23. rpc CheckIsOnlineByIDs (CheckIsOnlineByIDsParam) returns (CheckIsOnlineByIDsParam){};
  24. // 查询在线用户信息列表
  25. rpc FindOnlinePerson (google.protobuf.Empty) returns (OnlinePersonMessageReply);
  26. // 查询可以匹配的在线用户信息列表
  27. rpc FindOnlineCanMatchingPerson (google.protobuf.Empty) returns (OnlinePersonMessageReply);
  28. // 查询在线多少人
  29. rpc FindOnlinePersonNum (google.protobuf.Empty) returns (OnlinePersonReply);
  30. // 更新工作状态
  31. rpc UpdateWorkingStatus (UpdateWorkingStatusRequest) returns (google.protobuf.Empty){};
  32. // 更新权重
  33. rpc UpdateWeight (UpdateWeightRequest) returns (google.protobuf.Empty){};
  34. // 更新每日被匹配数
  35. rpc UpdateTodayMatchedNum (UpdateTodayMatchedNumRequest) returns (google.protobuf.Empty){};
  36. }
  37. message SendMessageInfo{
  38. int64 roomId = 1;// 房间ID
  39. common.Message message = 2;// 消息
  40. string msgType = 3;// 消息类型
  41. }
  42. message ChatIsReadInfo{
  43. int64 messageId = 1; // 消息的ID
  44. int64 roomId = 2; // 房间ID
  45. }
  46. message GotoRoomInfo{
  47. int64 roomId = 1; // 房间ID
  48. }
  49. message ReceiveRequest{
  50. string method = 1; // 路由
  51. bytes data = 2; // 数据
  52. string websocketTag = 3;
  53. }
  54. message ReceiveReply{
  55. }
  56. message OnlinePersonMessageReply{
  57. repeated OnlinePersonMessageInfo list = 1;
  58. }
  59. message OnlinePersonMessageInfo{
  60. int64 todayMatchedNum = 1;// 今日被匹配数
  61. string personId = 2;
  62. int64 weight = 3;// 权重
  63. string workingStatus = 4;// 工作状态
  64. int64 sex = 5;// 性别
  65. int64 age = 6;// 年龄
  66. string province = 7;// 省
  67. string city = 8;// 市
  68. }
  69. message OnlinePersonReply{
  70. int64 userManNum = 1; // 男用户在线数
  71. int64 userWomanNum = 2; // 女用户在线数
  72. int64 userOtherNum = 3; // 未填写性别的用户在线数
  73. }
  74. message CheckIsOnlineRequest{
  75. string userId = 1;// 身份ID
  76. }
  77. message CheckIsOnlineByIDsParam{
  78. repeated string userIds = 1;// 身份ID
  79. }
  80. message CheckIsOnlineReply{
  81. bool isOnline = 1;// 是否在线
  82. }
  83. message UpdateWorkingStatusRequest{
  84. string id = 1;
  85. string workingStatus = 2;
  86. }
  87. message UpdateWeightRequest{
  88. string id = 1;
  89. int64 weight = 2;
  90. }
  91. message UpdateTodayMatchedNumRequest{
  92. string id = 1;
  93. int64 todayMatchedNum = 2;
  94. }
  95. message SendMsgRequest{
  96. string id = 1;
  97. string method = 2;
  98. bytes data = 3;
  99. int32 code = 4;
  100. string message = 5;
  101. string websocketTag = 6;
  102. }
  103. message SendMsgReply{}