websocket.proto 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. message CheckIsOnlineRequest{
  22. string identifyId = 1;// 身份ID
  23. }
  24. message CheckIsOnlineReply{
  25. bool isOnline = 1;// 是否在线
  26. }
  27. message UpdateWorkingStatusRequest{
  28. string id = 1;
  29. string workingStatus = 2;
  30. }
  31. message UpdateWeightRequest{
  32. string id = 1;
  33. int64 weight = 2;
  34. }
  35. message MessageInfo{
  36. int64 roomId = 1; // 房间ID
  37. string message = 2;// 发送的消息
  38. string msgType = 3;// 消息类型
  39. }
  40. message SendMsgRequest{
  41. string id = 1;
  42. string method = 2;
  43. bytes data = 3;
  44. int32 code = 4;
  45. string message = 5;
  46. string websocketTag = 6;
  47. }
  48. message SendMsgReply{
  49. }
  50. message FindOnlinePersonReply{
  51. repeated OnlinePersonInfo list = 1;
  52. }
  53. message OnlinePersonInfo{
  54. string personType = 1;
  55. string personId = 2;
  56. int64 weight = 3;// 权重
  57. string workingStatus = 4;// 工作状态
  58. int64 sex = 5;// 性别
  59. }