websocket.proto 3.0 KB

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