websocket.proto 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. message UpdateWorkingStatusRequest{
  20. string id = 1;
  21. string workingStatus = 2;
  22. }
  23. message UpdateWeightRequest{
  24. string id = 1;
  25. int64 weight = 2;
  26. }
  27. message MessageInfo{
  28. int64 roomId = 1; // 房间ID
  29. string message = 2;// 发送的消息
  30. string msgType = 3;// 消息类型
  31. }
  32. message SendMsgRequest{
  33. string id = 1;
  34. string method = 2;
  35. bytes data = 3;
  36. int32 code = 4;
  37. string message = 5;
  38. string websocketTag = 6;
  39. }
  40. message SendMsgReply{
  41. }
  42. message FindOnlinePersonReply{
  43. repeated OnlinePersonInfo list = 1;
  44. }
  45. message OnlinePersonInfo{
  46. string personType = 1;
  47. string personId = 2;
  48. int64 weight = 3;// 权重
  49. string workingStatus = 4;// 工作状态
  50. }