api.proto 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. syntax = "proto3";
  2. package live.livedm.v1;
  3. option go_package = "v1";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. message SendMsgReq {
  6. int64 uid = 1 [(gogoproto.moretags) = 'form:"uid" validate:"required"'];
  7. int64 roomid = 2 [(gogoproto.moretags) = 'form:"roomid" validate:"required"'];
  8. string msg = 3 [(gogoproto.moretags) = 'form:"msg" validate:"required"'];
  9. string rnd = 4 [(gogoproto.moretags) = 'form:"rnd"'];
  10. string ip = 5 [(gogoproto.moretags) = 'form:"ip"'];
  11. int64 fontsize = 7 [(gogoproto.moretags) = 'form:"fontsize" validate:"gte=0"'];
  12. int64 mode = 8 [(gogoproto.moretags) = 'form:"mode" validate:"gte=0"'];
  13. string platform = 9 [(gogoproto.moretags) = 'form:"platform"'];
  14. int64 msgtype = 10 [(gogoproto.moretags) = 'form:"msgtype" validate:"gte=0"'];
  15. int64 bubble = 11 [(gogoproto.moretags) = 'form:"bubble"'];
  16. lancer lancer = 12 [(gogoproto.moretags) = 'form:"lancer"'];
  17. }
  18. message lancer {
  19. string buvid = 1 [(gogoproto.moretags) = 'form:"buvid"'];
  20. string userAgent = 2 [(gogoproto.moretags) = 'form:"userAgent"'];
  21. string refer = 3 [(gogoproto.moretags) = 'form:"refer"'];
  22. string cookie = 4 [(gogoproto.moretags) = 'form:"cookie"'];
  23. int64 build = 5 [(gogoproto.moretags) = 'form:"build"'];
  24. }
  25. message SendMsgResp {
  26. bool isLimit = 1 [(gogoproto.jsontag) = "islimit"];
  27. string limitMsg = 2 [(gogoproto.jsontag) = "limitmsg"];
  28. int32 code = 3 [(gogoproto.jsontag) = "code"];
  29. }
  30. message HistoryReq {
  31. int64 roomid = 1 [(gogoproto.moretags) = 'form:"roomid" validate:"required"'];
  32. }
  33. message HistoryResp{
  34. repeated string room = 1 [(gogoproto.jsontag) = "room"];
  35. repeated string admin = 2 [(gogoproto.jsontag) = "admin"];
  36. }
  37. message ErrMsg {
  38. string message =1;
  39. }
  40. service DM {
  41. rpc SendMsg(SendMsgReq) returns (SendMsgResp);
  42. rpc GetHistory(HistoryReq) returns (HistoryResp);
  43. }