websocket.proto 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. message MessageInfo{
  16. int64 roomId = 1; // 房间ID
  17. string message = 2;// 发送的消息
  18. string msgType = 3;// 消息类型
  19. }
  20. message SendMsgRequest{
  21. string id = 1;
  22. string method = 2;
  23. bytes data = 3;
  24. int32 code = 4;
  25. string message = 5;
  26. string websocketTag = 6;
  27. }
  28. message SendMsgReply{
  29. }
  30. message FindOnlinePersonReply{
  31. repeated OnlinePersonInfo list = 1;
  32. }
  33. message OnlinePersonInfo{
  34. string personType = 1;
  35. string personId = 2;
  36. int64 weight = 3;// 权重
  37. string workingStatus = 4;// 工作状态
  38. }