api.proto 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. syntax = "proto3";
  2. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  3. package live.broadcastproxy.v1;
  4. option go_package = "v1";
  5. service Danmaku {
  6. rpc RoomMessage (RoomMessageRequest) returns (GeneralResponse);
  7. rpc BroadcastMessage (BroadcastMessageRequest) returns(GeneralResponse);
  8. rpc MultiRoomMessage (MultiRoomMessageRequest) returns(GeneralResponse);
  9. rpc BatchRoomMessage(BatchRoomMessageRequest) returns(GeneralResponse);
  10. rpc UserMessage(UserMessageRequest)returns(GeneralResponse);
  11. rpc BatchUserMessage(BatchUserMessageRequest)returns(GeneralResponse);
  12. rpc Dispatch(DispatchRequest)returns(DispatchResponse);
  13. rpc SetAngryValue(SetAngryValueRequest)returns(SetAngryValueResponse);
  14. rpc GetRoomOnlineCount(GetRoomOnlineCountRequest)returns(GetRoomOnlineCountResponse);
  15. }
  16. message GeneralResponse {
  17. }
  18. message RoomMessageRequest {
  19. int32 room_id = 1 [(gogoproto.jsontag) = "room_id"];
  20. string message = 2 [(gogoproto.jsontag) = "msg"];
  21. int32 ensure = 3;
  22. }
  23. message BroadcastMessageRequest {
  24. string message = 1;
  25. repeated int32 exclude_room_id = 2;
  26. }
  27. message MultiRoomMessageRequest {
  28. repeated int32 room_id = 1 [(gogoproto.jsontag) = "room_id"];
  29. string message = 2 [(gogoproto.jsontag) = "msg"];
  30. int32 ensure = 3;
  31. }
  32. message BatchRoomMessageRequest {
  33. repeated RoomMessageRequest room_message = 1 [(gogoproto.jsontag) = "data"];
  34. }
  35. message UserMessageRequest {
  36. int64 user_id = 1 [(gogoproto.jsontag) = "uid"];
  37. string message = 2 [(gogoproto.jsontag) = "msg"];
  38. }
  39. message BatchUserMessageRequest {
  40. repeated UserMessageRequest user_message = 1 [(gogoproto.jsontag) = "data"];
  41. }
  42. message DispatchRequest {
  43. int64 user_id = 1 [(gogoproto.jsontag) = "uid"];
  44. string user_ip = 2 [(gogoproto.jsontag) = "ip"];
  45. }
  46. message DispatchResponse {
  47. repeated string ip = 1 [(gogoproto.jsontag) = "ip"];
  48. repeated string host = 2 [(gogoproto.jsontag) = "host"];
  49. }
  50. message SetAngryValueRequest {
  51. map<uint64,uint64> angry_value = 1 [(gogoproto.jsontag) = "angry_value"];
  52. }
  53. message SetAngryValueResponse {
  54. }
  55. message GetRoomOnlineCountRequest {
  56. repeated uint64 room_id = 1 [(gogoproto.jsontag) = "room_id"];
  57. }
  58. message GetRoomOnlineCountResponse {
  59. map<uint64,uint64> room_online_count = 1 [(gogoproto.jsontag) = "room_online_count"];
  60. }