websocket.proto 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 SendMsg (SendMsgRequest) returns (SendMsgReply){};
  14. // 更新工作状态
  15. rpc UpdateWorkingStatus (UpdateWorkingStatusRequest) returns (google.protobuf.Empty){};
  16. // 更新权重
  17. rpc UpdateWeight (UpdateWeightRequest) returns (google.protobuf.Empty){};
  18. // 检查是否在线
  19. rpc CheckIsOnline (CheckIsOnlineRequest) returns (CheckIsOnlineReply){};
  20. // 检查是否在线
  21. rpc CheckIsOnlineByIDs (CheckIsOnlineByIDsParam) returns (CheckIsOnlineByIDsParam){};
  22. // 查询在线多少人
  23. rpc FindOnlinePersonNum (google.protobuf.Empty) returns (OnlinePersonReply);
  24. }
  25. message OnlinePersonReply{
  26. int64 userManNum = 1; // 男用户在线数
  27. int64 userWomanNum = 2; // 女用户在线数
  28. int64 userOtherNum = 3; // 未填写性别的用户在线数
  29. }
  30. message CheckIsOnlineRequest{
  31. string userId = 1;// 身份ID
  32. }
  33. message CheckIsOnlineByIDsParam{
  34. repeated string userIds = 1;// 身份ID
  35. }
  36. message CheckIsOnlineReply{
  37. bool isOnline = 1;// 是否在线
  38. }
  39. message UpdateWorkingStatusRequest{
  40. string id = 1;
  41. string workingStatus = 2;
  42. }
  43. message UpdateWeightRequest{
  44. string id = 1;
  45. int64 weight = 2;
  46. }
  47. message MessageInfo{
  48. int64 roomId = 1; // 房间ID
  49. string message = 2;// 发送的消息
  50. string msgType = 3;// 消息类型
  51. }
  52. message SendMsgRequest{
  53. string id = 1;
  54. string method = 2;
  55. bytes data = 3;
  56. int32 code = 4;
  57. string message = 5;
  58. string websocketTag = 6;
  59. }
  60. message SendMsgReply{
  61. }
  62. message FindOnlinePersonReply{
  63. repeated OnlinePersonInfo list = 1;
  64. }
  65. message OnlinePersonInfo{
  66. string personId = 2;
  67. int64 weight = 3;// 权重
  68. string workingStatus = 4;// 工作状态
  69. int64 sex = 5;// 性别
  70. }