payGoods.bm.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: payGoods.proto
  3. /*
  4. Package v1 is a generated blademaster stub package.
  5. This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
  6. It is generated from these files:
  7. payGoods.proto
  8. */
  9. package v1
  10. import (
  11. "context"
  12. bm "go-common/library/net/http/blademaster"
  13. "go-common/library/net/http/blademaster/binding"
  14. )
  15. // to suppressed 'imported but not used warning'
  16. var _ *bm.Context
  17. var _ context.Context
  18. var _ binding.StructValidator
  19. var PathPayGoodsAdd = "/live.liveadmin.v1.PayGoods/add"
  20. var PathPayGoodsUpdate = "/live.liveadmin.v1.PayGoods/update"
  21. var PathPayGoodsGetList = "/live.liveadmin.v1.PayGoods/getList"
  22. var PathPayGoodsClose = "/live.liveadmin.v1.PayGoods/close"
  23. var PathPayGoodsOpen = "/live.liveadmin.v1.PayGoods/open"
  24. // ==================
  25. // PayGoods Interface
  26. // ==================
  27. type PayGoodsBMServer interface {
  28. // `method:"POST" internal:"true"` 生成一张付费直播票
  29. Add(ctx context.Context, req *PayGoodsAddReq) (resp *PayGoodsAddResp, err error)
  30. // `method:"POST" internal:"true"` 更新一张付费直播票
  31. Update(ctx context.Context, req *PayGoodsUpdateReq) (resp *PayGoodsUpdateResp, err error)
  32. // `internal:"true"` 获取付费直播票列表
  33. GetList(ctx context.Context, req *PayGoodsGetListReq) (resp *PayGoodsGetListResp, err error)
  34. // `method:"POST" internal:"true"` 关闭购票
  35. Close(ctx context.Context, req *PayGoodsCloseReq) (resp *PayGoodsCloseResp, err error)
  36. // `method:"POST" internal:"true"` 开启购票
  37. Open(ctx context.Context, req *PayGoodsOpenReq) (resp *PayGoodsOpenResp, err error)
  38. }
  39. var v1PayGoodsSvc PayGoodsBMServer
  40. func payGoodsAdd(c *bm.Context) {
  41. p := new(PayGoodsAddReq)
  42. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  43. return
  44. }
  45. resp, err := v1PayGoodsSvc.Add(c, p)
  46. c.JSON(resp, err)
  47. }
  48. func payGoodsUpdate(c *bm.Context) {
  49. p := new(PayGoodsUpdateReq)
  50. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  51. return
  52. }
  53. resp, err := v1PayGoodsSvc.Update(c, p)
  54. c.JSON(resp, err)
  55. }
  56. func payGoodsGetList(c *bm.Context) {
  57. p := new(PayGoodsGetListReq)
  58. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  59. return
  60. }
  61. resp, err := v1PayGoodsSvc.GetList(c, p)
  62. c.JSON(resp, err)
  63. }
  64. func payGoodsClose(c *bm.Context) {
  65. p := new(PayGoodsCloseReq)
  66. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  67. return
  68. }
  69. resp, err := v1PayGoodsSvc.Close(c, p)
  70. c.JSON(resp, err)
  71. }
  72. func payGoodsOpen(c *bm.Context) {
  73. p := new(PayGoodsOpenReq)
  74. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  75. return
  76. }
  77. resp, err := v1PayGoodsSvc.Open(c, p)
  78. c.JSON(resp, err)
  79. }
  80. // RegisterV1PayGoodsService Register the blademaster route with middleware map
  81. // midMap is the middleware map, the key is defined in proto
  82. func RegisterV1PayGoodsService(e *bm.Engine, svc PayGoodsBMServer, midMap map[string]bm.HandlerFunc) {
  83. v1PayGoodsSvc = svc
  84. e.POST("/xlive/internal/live-admin/v1/payGoods/add", payGoodsAdd)
  85. e.POST("/xlive/internal/live-admin/v1/payGoods/update", payGoodsUpdate)
  86. e.GET("/xlive/internal/live-admin/v1/payGoods/getList", payGoodsGetList)
  87. e.POST("/xlive/internal/live-admin/v1/payGoods/close", payGoodsClose)
  88. e.POST("/xlive/internal/live-admin/v1/payGoods/open", payGoodsOpen)
  89. }
  90. // RegisterPayGoodsBMServer Register the blademaster route
  91. func RegisterPayGoodsBMServer(e *bm.Engine, server PayGoodsBMServer) {
  92. v1PayGoodsSvc = server
  93. e.POST("/live.liveadmin.v1.PayGoods/add", payGoodsAdd)
  94. e.POST("/live.liveadmin.v1.PayGoods/update", payGoodsUpdate)
  95. e.GET("/live.liveadmin.v1.PayGoods/getList", payGoodsGetList)
  96. e.POST("/live.liveadmin.v1.PayGoods/close", payGoodsClose)
  97. e.POST("/live.liveadmin.v1.PayGoods/open", payGoodsOpen)
  98. }