payLive.bm.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: payLive.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. payLive.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 PathPayLiveAdd = "/live.liveadmin.v1.PayLive/add"
  20. var PathPayLiveUpdate = "/live.liveadmin.v1.PayLive/update"
  21. var PathPayLiveGetList = "/live.liveadmin.v1.PayLive/getList"
  22. var PathPayLiveClose = "/live.liveadmin.v1.PayLive/close"
  23. var PathPayLiveOpen = "/live.liveadmin.v1.PayLive/open"
  24. // =================
  25. // PayLive Interface
  26. // =================
  27. type PayLiveBMServer interface {
  28. // `method:"POST" internal:"true"` 生成付费直播信息
  29. Add(ctx context.Context, req *PayLiveAddReq) (resp *PayLiveAddResp, err error)
  30. // `method:"POST" internal:"true"` 更新付费直播信息
  31. Update(ctx context.Context, req *PayLiveUpdateReq) (resp *PayLiveUpdateResp, err error)
  32. // `internal:"true"` 获取付费直播列表
  33. GetList(ctx context.Context, req *PayLiveGetListReq) (resp *PayLiveGetListResp, err error)
  34. // `method:"POST" internal:"true"` 关闭鉴权
  35. Close(ctx context.Context, req *PayLiveCloseReq) (resp *PayLiveCloseResp, err error)
  36. // `method:"POST" internal:"true"` 开启鉴权
  37. Open(ctx context.Context, req *PayLiveOpenReq) (resp *PayLiveOpenResp, err error)
  38. }
  39. var v1PayLiveSvc PayLiveBMServer
  40. func payLiveAdd(c *bm.Context) {
  41. p := new(PayLiveAddReq)
  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 := v1PayLiveSvc.Add(c, p)
  46. c.JSON(resp, err)
  47. }
  48. func payLiveUpdate(c *bm.Context) {
  49. p := new(PayLiveUpdateReq)
  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 := v1PayLiveSvc.Update(c, p)
  54. c.JSON(resp, err)
  55. }
  56. func payLiveGetList(c *bm.Context) {
  57. p := new(PayLiveGetListReq)
  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 := v1PayLiveSvc.GetList(c, p)
  62. c.JSON(resp, err)
  63. }
  64. func payLiveClose(c *bm.Context) {
  65. p := new(PayLiveCloseReq)
  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 := v1PayLiveSvc.Close(c, p)
  70. c.JSON(resp, err)
  71. }
  72. func payLiveOpen(c *bm.Context) {
  73. p := new(PayLiveOpenReq)
  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 := v1PayLiveSvc.Open(c, p)
  78. c.JSON(resp, err)
  79. }
  80. // RegisterV1PayLiveService Register the blademaster route with middleware map
  81. // midMap is the middleware map, the key is defined in proto
  82. func RegisterV1PayLiveService(e *bm.Engine, svc PayLiveBMServer, midMap map[string]bm.HandlerFunc) {
  83. v1PayLiveSvc = svc
  84. e.POST("/xlive/internal/live-admin/v1/payLive/add", payLiveAdd)
  85. e.POST("/xlive/internal/live-admin/v1/payLive/update", payLiveUpdate)
  86. e.GET("/xlive/internal/live-admin/v1/payLive/getList", payLiveGetList)
  87. e.POST("/xlive/internal/live-admin/v1/payLive/close", payLiveClose)
  88. e.POST("/xlive/internal/live-admin/v1/payLive/open", payLiveOpen)
  89. }
  90. // RegisterPayLiveBMServer Register the blademaster route
  91. func RegisterPayLiveBMServer(e *bm.Engine, server PayLiveBMServer) {
  92. v1PayLiveSvc = server
  93. e.POST("/live.liveadmin.v1.PayLive/add", payLiveAdd)
  94. e.POST("/live.liveadmin.v1.PayLive/update", payLiveUpdate)
  95. e.GET("/live.liveadmin.v1.PayLive/getList", payLiveGetList)
  96. e.POST("/live.liveadmin.v1.PayLive/close", payLiveClose)
  97. e.POST("/live.liveadmin.v1.PayLive/open", payLiveOpen)
  98. }