gift.proto 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. syntax = "proto3";
  2. package live.approom.v1;
  3. option go_package = "v1";
  4. option (gogoproto.goproto_getters_all) = false;
  5. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  6. service Gift{
  7. // 每日礼包接口
  8. // `midware:"guest"`
  9. rpc daily_bag(DailyBagReq) returns (DailyBagResp);
  10. // `midware:"auth"`
  11. rpc NeedTipRecharge (NeedTipRechargeReq) returns (NeedTipRechargeResp);
  12. // `midware:"auth" method:"post"`
  13. rpc TipRechargeAction (TipRechargeActionReq) returns(TipRechargeActionResp);
  14. //礼物全量配置
  15. rpc gift_config(GiftConfigReq) returns (GiftConfigResp);
  16. }
  17. message DailyBagReq{
  18. }
  19. message DailyBagResp{
  20. int64 bag_status=1 [(gogoproto.jsontag)="bag_status"];
  21. int64 bag_expire_status=2 [(gogoproto.jsontag)="bag_expire_status"];
  22. BagToast bag_toast = 3 [(gogoproto.jsontag)="bag_toast"];
  23. message BagToast{
  24. int64 toast_status=1 [(gogoproto.jsontag)="toast_status"];
  25. string toast_message=2 [(gogoproto.jsontag)="toast_message"];
  26. }
  27. repeated BagList bag_list = 4 [(gogoproto.jsontag)="bag_list"];
  28. message BagList{
  29. int64 type=1 [(gogoproto.jsontag)="type"];
  30. string bag_name=2 [(gogoproto.jsontag)="bag_name"];
  31. Source source = 3 [(gogoproto.jsontag)="source"];
  32. message Source{
  33. int64 medal_id = 1 [(gogoproto.jsontag)="medal_id"];
  34. string medal_name = 2 [(gogoproto.jsontag)="medal_name"];
  35. int64 level = 3 [(gogoproto.jsontag)="level"];
  36. int64 user_level = 4 [(gogoproto.jsontag)="user_level"];
  37. }
  38. repeated GiftList gift_list = 4 [(gogoproto.jsontag)="gift_list"];
  39. message GiftList{
  40. string gift_id=1 [(gogoproto.jsontag)="gift_id"];
  41. int64 gift_num=2 [(gogoproto.jsontag)="gift_num"];
  42. int64 expire_at=3 [(gogoproto.jsontag)="expire_at"];
  43. }
  44. }
  45. }
  46. message GiftConfigReq{
  47. string platform = 1 [(gogoproto.moretags) = 'form:"platform"'];
  48. int64 build = 2 [(gogoproto.moretags) = 'form:"build"'];
  49. }
  50. message GiftConfigResp{
  51. repeated Config list = 1 [(gogoproto.jsontag)="list"];
  52. message Config{
  53. int64 id = 1 [(gogoproto.jsontag)="id"];
  54. string name = 2 [(gogoproto.jsontag)="name"];
  55. int64 price = 3 [(gogoproto.jsontag)="price"];
  56. int64 type = 4 [(gogoproto.jsontag)="type"];
  57. string coin_type = 5 [(gogoproto.jsontag)="coin_type"];
  58. int64 bag_gift = 6 [(gogoproto.jsontag)="bag_gift"];
  59. int64 effect = 7 [(gogoproto.jsontag)="effect"];
  60. string corner_mark = 8 [(gogoproto.jsontag)="corner_mark"];
  61. int64 broadcast = 9 [(gogoproto.jsontag)="broadcast"];
  62. int64 draw = 10 [(gogoproto.jsontag)="draw"];
  63. int64 stay_time = 11 [(gogoproto.jsontag)="stay_time"];
  64. int64 animation_frame_num = 12 [(gogoproto.jsontag)="animation_frame_num"];
  65. string desc = 13 [(gogoproto.jsontag)="desc"];
  66. string rule = 14 [(gogoproto.jsontag)="rule"];
  67. string rights = 15 [(gogoproto.jsontag)="rights"];
  68. int64 privilege_required = 16 [(gogoproto.jsontag)="privilege_required"];
  69. repeated CountMap count_map = 17 [(gogoproto.jsontag)="count_map"];
  70. string img_basic = 18 [(gogoproto.jsontag)="img_basic"];
  71. string img_dynamic = 19 [(gogoproto.jsontag)="img_dynamic"];
  72. string frame_animation = 20 [(gogoproto.jsontag)="frame_animation"];
  73. string gif = 21 [(gogoproto.jsontag)="gif"];
  74. string webp = 22 [(gogoproto.jsontag)="webp"];
  75. string full_sc_web = 23 [(gogoproto.jsontag)="full_sc_web"];
  76. string full_sc_horizontal = 24 [(gogoproto.jsontag)="full_sc_horizontal"];
  77. string full_sc_vertical = 25 [(gogoproto.jsontag)="full_sc_vertical"];
  78. string full_sc_horizontal_svga = 26 [(gogoproto.jsontag)="full_sc_horizontal_svga"];
  79. string full_sc_vertical_svga = 27 [(gogoproto.jsontag)="full_sc_vertical_svga"];
  80. string bullet_head = 28 [(gogoproto.jsontag)="bullet_head"];
  81. string bullet_tail = 29 [(gogoproto.jsontag)="bullet_tail"];
  82. int64 limit_interval = 30 [(gogoproto.jsontag)="limit_interval"];
  83. }
  84. message CountMap{
  85. int64 num = 1 [(gogoproto.jsontag)="num"];
  86. string text = 2 [(gogoproto.jsontag)="text"];
  87. }
  88. }
  89. enum from {
  90. None = 0;
  91. Gold = 1;
  92. Silver = 2;
  93. }
  94. enum userAction {
  95. ActionNone = 0;
  96. StopPush = 1;
  97. }
  98. message NeedTipRechargeReq {
  99. // 来源 1金瓜子 2 银瓜子
  100. from from = 1 [(gogoproto.moretags) = 'form:"from" validate:"required"'];
  101. // 需要的金瓜子 如果From=2 那么直接传0
  102. int64 needGold = 2 [(gogoproto.moretags) = 'form:"needGold"'];
  103. // 平台 android ios
  104. string platform = 3 [(gogoproto.moretags) = 'form:"platform" validate:"required"'];
  105. }
  106. message NeedTipRechargeResp {
  107. // 是否展示
  108. int32 show = 1 [(gogoproto.jsontag) = "show"];
  109. // bp
  110. float bp = 2 [(gogoproto.jsontag) = "bp"];
  111. // bp券
  112. float bpCoupon = 3 [(gogoproto.jsontag) = "bpCoupon"];
  113. // 需要充值的金瓜子
  114. int64 rechargeGold = 4 [(gogoproto.jsontag) = "rechargeGold"];
  115. }
  116. message TipRechargeActionReq {
  117. // 来源 1金瓜子 2 银瓜子
  118. from from = 1 [(gogoproto.moretags) = 'form:"from" validate:"required"'];
  119. //行为 1 停止推送
  120. userAction action = 2 [(gogoproto.moretags) = 'form:"action" validate:"required"'];
  121. }
  122. message TipRechargeActionResp {
  123. }