payGoods.proto 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. syntax = "proto3";
  2. package live.liveadmin.v1;
  3. option go_package = "v1";
  4. option (gogoproto.goproto_getters_all) = false;
  5. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  6. service PayGoods {
  7. // `method:"POST" internal:"true"` 生成一张付费直播票
  8. rpc add (PayGoodsAddReq) returns (PayGoodsAddResp);
  9. // `method:"POST" internal:"true"` 更新一张付费直播票
  10. rpc update (PayGoodsUpdateReq) returns (PayGoodsUpdateResp);
  11. // `internal:"true"` 获取付费直播票列表
  12. rpc getList (PayGoodsGetListReq) returns (PayGoodsGetListResp);
  13. // `method:"POST" internal:"true"` 关闭购票
  14. rpc close (PayGoodsCloseReq) returns (PayGoodsCloseResp);
  15. // `method:"POST" internal:"true"` 开启购票
  16. rpc open (PayGoodsOpenReq) returns (PayGoodsOpenResp);
  17. }
  18. message PayGoodsAddReq {
  19. // 平台
  20. string platform = 1 [(gogoproto.moretags) = 'form:"platform"'];
  21. // 商品名称
  22. string title = 2 [(gogoproto.moretags) = 'form:"title" validate:"required"'];
  23. // 商品类型 2 付费直播门票
  24. int64 type = 3 [(gogoproto.moretags) = 'form:"type" validate:"required"'];
  25. // 商品价格(分)
  26. int64 price = 4 [(gogoproto.moretags) = 'form:"price" validate:"required"'];
  27. // 开始时间
  28. string start_time = 5 [(gogoproto.moretags) = 'form:"start_time" validate:"required"'];
  29. // 结束时间
  30. string end_time = 6 [(gogoproto.moretags) = 'form:"end_time" validate:"required"'];
  31. // ip限制,0不限制,1仅限大陆,2仅限港澳台,3大陆+港澳台
  32. int64 ip_limit = 7 [(gogoproto.moretags) = 'form:"ip_limit"'];
  33. }
  34. message PayGoodsAddResp {
  35. }
  36. message PayGoodsUpdateReq {
  37. // 购票id
  38. int64 id = 1 [(gogoproto.moretags) = 'form:"id"'];
  39. // 平台
  40. string platform = 2 [(gogoproto.moretags) = 'form:"platform"'];
  41. // 商品名称
  42. string title = 3 [(gogoproto.moretags) = 'form:"title"'];
  43. // 商品类型 2 付费直播门票
  44. int64 type = 4 [(gogoproto.moretags) = 'form:"type"'];
  45. // 商品价格(分)
  46. int64 price = 5 [(gogoproto.moretags) = 'form:"price"'];
  47. // 开始时间
  48. string start_time = 6 [(gogoproto.moretags) = 'form:"start_time"'];
  49. // 结束时间
  50. string end_time = 7 [(gogoproto.moretags) = 'form:"end_time"'];
  51. // ip限制,0不限制,1仅限大陆,2仅限港澳台,3大陆+港澳台
  52. int64 ip_limit = 8 [(gogoproto.moretags) = 'form:"ip_limit"'];
  53. }
  54. message PayGoodsUpdateResp {
  55. }
  56. message PayGoodsGetListReq {
  57. // 购票id
  58. int64 id = 1 [(gogoproto.moretags) = 'form:"id"'];
  59. // 平台
  60. string platform = 2 [(gogoproto.moretags) = 'form:"platform"'];
  61. // 商品名称
  62. string title = 3 [(gogoproto.moretags) = 'form:"title"'];
  63. // 商品类型 2 付费直播门票
  64. int64 type = 4 [(gogoproto.moretags) = 'form:"type"'];
  65. // ip限制,0不限制,1仅限大陆,2仅限港澳台,3大陆+港澳台
  66. int64 ip_limit = 5 [(gogoproto.moretags) = 'form:"ip_limit"'];
  67. // 页号,0开始
  68. int64 page_num = 6 [(gogoproto.moretags) = 'form:"page_num"'];
  69. // 每页个数
  70. int64 page_size = 7 [(gogoproto.moretags) = 'form:"page_size"'];
  71. }
  72. message PayGoodsGetListResp {
  73. message PageInfo {
  74. // 记录总数
  75. int64 total_count = 1 [(gogoproto.jsontag) = "total_count"];
  76. // 当前页号
  77. int64 page_num = 2 [(gogoproto.jsontag) = "page_num"];
  78. }
  79. message GoodsInfo {
  80. // 购票id
  81. int64 id = 1 [(gogoproto.jsontag) = "id"];
  82. // 标题
  83. string title = 2 [(gogoproto.jsontag) = "title"];
  84. // 平台
  85. string platform = 3 [(gogoproto.jsontag) = "platform"];
  86. // 类型,2为付费直播
  87. int64 type = 4 [(gogoproto.jsontag) = "type"];
  88. // 价格,分
  89. int64 price = 5 [(gogoproto.jsontag) = "price"];
  90. // 开始购票时间
  91. string start_time = 6 [(gogoproto.jsontag) = "start_time"];
  92. // 结束购票时间
  93. string end_time = 7 [(gogoproto.jsontag) = "end_time"];
  94. // ip限制
  95. int64 ip_limit = 8 [(gogoproto.jsontag) = "ip_limit"];
  96. // 购票状态,0关闭,1购票中,2未开始
  97. int64 status = 9 [(gogoproto.jsontag) = "status"];
  98. }
  99. //
  100. PageInfo page_info = 1 [(gogoproto.jsontag) = "page_info"];
  101. //
  102. repeated GoodsInfo goods_info = 2 [(gogoproto.jsontag) = "goods_info"];
  103. }
  104. message PayGoodsCloseReq {
  105. // 购票id
  106. int64 id = 1 [(gogoproto.moretags) = 'form:"id" validate:"required"'];
  107. }
  108. message PayGoodsCloseResp {
  109. }
  110. message PayGoodsOpenReq {
  111. // 购票id
  112. int64 id = 1 [(gogoproto.moretags) = 'form:"id" validate:"required"'];
  113. }
  114. message PayGoodsOpenResp {
  115. }