websocket.proto 2.8 KB

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