online.proto 2.7 KB

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