capsule.bm.go 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: capsule.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. capsule.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 PathCapsuleGetCoinList = "/live.liveadmin.v1.Capsule/get_coin_list"
  20. var PathCapsuleUpdateCoinConfig = "/live.liveadmin.v1.Capsule/update_coin_config"
  21. var PathCapsuleUpdateCoinStatus = "/live.liveadmin.v1.Capsule/update_coin_status"
  22. var PathCapsuleDeleteCoin = "/live.liveadmin.v1.Capsule/delete_coin"
  23. var PathCapsuleGetPoolList = "/live.liveadmin.v1.Capsule/get_pool_list"
  24. var PathCapsuleUpdatePool = "/live.liveadmin.v1.Capsule/update_pool"
  25. var PathCapsuleDeletePool = "/live.liveadmin.v1.Capsule/delete_pool"
  26. var PathCapsuleUpdatePoolStatus = "/live.liveadmin.v1.Capsule/update_pool_status"
  27. var PathCapsuleGetPoolPrize = "/live.liveadmin.v1.Capsule/get_pool_prize"
  28. var PathCapsuleGetPrizeType = "/live.liveadmin.v1.Capsule/get_prize_type"
  29. var PathCapsuleGetPrizeExpire = "/live.liveadmin.v1.Capsule/get_prize_expire"
  30. var PathCapsuleUpdatePoolPrize = "/live.liveadmin.v1.Capsule/update_pool_prize"
  31. var PathCapsuleDeletePoolPrize = "/live.liveadmin.v1.Capsule/delete_pool_prize"
  32. var PathCapsuleGetCouponList = "/live.liveadmin.v1.Capsule/get_coupon_list"
  33. // =================
  34. // Capsule Interface
  35. // =================
  36. type CapsuleBMServer interface {
  37. // `internal:"true"`
  38. GetCoinList(ctx context.Context, req *GetCoinListReqAdmin) (resp *GetCoinListRespAdmin, err error)
  39. // `method:"POST" internal:"true"`
  40. UpdateCoinConfig(ctx context.Context, req *UpdateCoinConfigReqAdmin) (resp *UpdateCoinConfigRespAdmin, err error)
  41. // `method:"POST" internal:"true"`
  42. UpdateCoinStatus(ctx context.Context, req *UpdateCoinStatusReqAdmin) (resp *UpdateCoinStatusRespAdmin, err error)
  43. // `method:"POST" internal:"true"`
  44. DeleteCoin(ctx context.Context, req *DeleteCoinReqAdmin) (resp *DeleteCoinRespAdmin, err error)
  45. // `internal:"true"`
  46. GetPoolList(ctx context.Context, req *GetPoolListReqAdmin) (resp *GetPoolListRespAdmin, err error)
  47. // `method:"POST" internal:"true"`
  48. UpdatePool(ctx context.Context, req *UpdatePoolReqAdmin) (resp *UpdatePoolRespAdmin, err error)
  49. // `method:"POST" internal:"true"`
  50. DeletePool(ctx context.Context, req *DeletePoolReqAdmin) (resp *DeletePoolRespAdmin, err error)
  51. // `method:"POST" internal:"true"`
  52. UpdatePoolStatus(ctx context.Context, req *UpdatePoolStatusReqAdmin) (resp *UpdatePoolStatusRespAdmin, err error)
  53. // `internal:"true"`
  54. GetPoolPrize(ctx context.Context, req *GetPoolPrizeReqAdmin) (resp *GetPoolPrizeRespAdmin, err error)
  55. // `internal:"true"`
  56. GetPrizeType(ctx context.Context, req *GetPrizeTypeReq) (resp *GetPrizeTypeResp, err error)
  57. // `internal:"true"`
  58. GetPrizeExpire(ctx context.Context, req *GetPrizeExpireReq) (resp *GetPrizeExpireResp, err error)
  59. // `method:"POST" internal:"true"`
  60. UpdatePoolPrize(ctx context.Context, req *UpdatePoolPrizeReqAdmin) (resp *UpdatePoolPrizeRespAdmin, err error)
  61. // `method:"POST" internal:"true" `
  62. DeletePoolPrize(ctx context.Context, req *DeletePoolPrizeReqAdmin) (resp *DeletePoolPrizeRespAdmin, err error)
  63. // `internal:"true"`
  64. GetCouponList(ctx context.Context, req *CapsuleGetCouponListReq) (resp *CapsuleGetCouponListResp, err error)
  65. }
  66. var v1CapsuleSvc CapsuleBMServer
  67. func capsuleGetCoinList(c *bm.Context) {
  68. p := new(GetCoinListReqAdmin)
  69. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  70. return
  71. }
  72. resp, err := v1CapsuleSvc.GetCoinList(c, p)
  73. c.JSON(resp, err)
  74. }
  75. func capsuleUpdateCoinConfig(c *bm.Context) {
  76. p := new(UpdateCoinConfigReqAdmin)
  77. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  78. return
  79. }
  80. resp, err := v1CapsuleSvc.UpdateCoinConfig(c, p)
  81. c.JSON(resp, err)
  82. }
  83. func capsuleUpdateCoinStatus(c *bm.Context) {
  84. p := new(UpdateCoinStatusReqAdmin)
  85. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  86. return
  87. }
  88. resp, err := v1CapsuleSvc.UpdateCoinStatus(c, p)
  89. c.JSON(resp, err)
  90. }
  91. func capsuleDeleteCoin(c *bm.Context) {
  92. p := new(DeleteCoinReqAdmin)
  93. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  94. return
  95. }
  96. resp, err := v1CapsuleSvc.DeleteCoin(c, p)
  97. c.JSON(resp, err)
  98. }
  99. func capsuleGetPoolList(c *bm.Context) {
  100. p := new(GetPoolListReqAdmin)
  101. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  102. return
  103. }
  104. resp, err := v1CapsuleSvc.GetPoolList(c, p)
  105. c.JSON(resp, err)
  106. }
  107. func capsuleUpdatePool(c *bm.Context) {
  108. p := new(UpdatePoolReqAdmin)
  109. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  110. return
  111. }
  112. resp, err := v1CapsuleSvc.UpdatePool(c, p)
  113. c.JSON(resp, err)
  114. }
  115. func capsuleDeletePool(c *bm.Context) {
  116. p := new(DeletePoolReqAdmin)
  117. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  118. return
  119. }
  120. resp, err := v1CapsuleSvc.DeletePool(c, p)
  121. c.JSON(resp, err)
  122. }
  123. func capsuleUpdatePoolStatus(c *bm.Context) {
  124. p := new(UpdatePoolStatusReqAdmin)
  125. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  126. return
  127. }
  128. resp, err := v1CapsuleSvc.UpdatePoolStatus(c, p)
  129. c.JSON(resp, err)
  130. }
  131. func capsuleGetPoolPrize(c *bm.Context) {
  132. p := new(GetPoolPrizeReqAdmin)
  133. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  134. return
  135. }
  136. resp, err := v1CapsuleSvc.GetPoolPrize(c, p)
  137. c.JSON(resp, err)
  138. }
  139. func capsuleGetPrizeType(c *bm.Context) {
  140. p := new(GetPrizeTypeReq)
  141. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  142. return
  143. }
  144. resp, err := v1CapsuleSvc.GetPrizeType(c, p)
  145. c.JSON(resp, err)
  146. }
  147. func capsuleGetPrizeExpire(c *bm.Context) {
  148. p := new(GetPrizeExpireReq)
  149. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  150. return
  151. }
  152. resp, err := v1CapsuleSvc.GetPrizeExpire(c, p)
  153. c.JSON(resp, err)
  154. }
  155. func capsuleUpdatePoolPrize(c *bm.Context) {
  156. p := new(UpdatePoolPrizeReqAdmin)
  157. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  158. return
  159. }
  160. resp, err := v1CapsuleSvc.UpdatePoolPrize(c, p)
  161. c.JSON(resp, err)
  162. }
  163. func capsuleDeletePoolPrize(c *bm.Context) {
  164. p := new(DeletePoolPrizeReqAdmin)
  165. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  166. return
  167. }
  168. resp, err := v1CapsuleSvc.DeletePoolPrize(c, p)
  169. c.JSON(resp, err)
  170. }
  171. func capsuleGetCouponList(c *bm.Context) {
  172. p := new(CapsuleGetCouponListReq)
  173. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  174. return
  175. }
  176. resp, err := v1CapsuleSvc.GetCouponList(c, p)
  177. c.JSON(resp, err)
  178. }
  179. // RegisterV1CapsuleService Register the blademaster route with middleware map
  180. // midMap is the middleware map, the key is defined in proto
  181. func RegisterV1CapsuleService(e *bm.Engine, svc CapsuleBMServer, midMap map[string]bm.HandlerFunc) {
  182. v1CapsuleSvc = svc
  183. e.GET("/xlive/internal/live-admin/v1/capsule/get_coin_list", capsuleGetCoinList)
  184. e.POST("/xlive/internal/live-admin/v1/capsule/update_coin_config", capsuleUpdateCoinConfig)
  185. e.POST("/xlive/internal/live-admin/v1/capsule/update_coin_status", capsuleUpdateCoinStatus)
  186. e.POST("/xlive/internal/live-admin/v1/capsule/delete_coin", capsuleDeleteCoin)
  187. e.GET("/xlive/internal/live-admin/v1/capsule/get_pool_list", capsuleGetPoolList)
  188. e.POST("/xlive/internal/live-admin/v1/capsule/update_pool", capsuleUpdatePool)
  189. e.POST("/xlive/internal/live-admin/v1/capsule/delete_pool", capsuleDeletePool)
  190. e.POST("/xlive/internal/live-admin/v1/capsule/update_pool_status", capsuleUpdatePoolStatus)
  191. e.GET("/xlive/internal/live-admin/v1/capsule/get_pool_prize", capsuleGetPoolPrize)
  192. e.GET("/xlive/internal/live-admin/v1/capsule/get_prize_type", capsuleGetPrizeType)
  193. e.GET("/xlive/internal/live-admin/v1/capsule/get_prize_expire", capsuleGetPrizeExpire)
  194. e.POST("/xlive/internal/live-admin/v1/capsule/update_pool_prize", capsuleUpdatePoolPrize)
  195. e.POST("/xlive/internal/live-admin/v1/capsule/delete_pool_prize", capsuleDeletePoolPrize)
  196. e.GET("/xlive/internal/live-admin/v1/capsule/get_coupon_list", capsuleGetCouponList)
  197. }
  198. // RegisterCapsuleBMServer Register the blademaster route
  199. func RegisterCapsuleBMServer(e *bm.Engine, server CapsuleBMServer) {
  200. v1CapsuleSvc = server
  201. e.GET("/live.liveadmin.v1.Capsule/get_coin_list", capsuleGetCoinList)
  202. e.POST("/live.liveadmin.v1.Capsule/update_coin_config", capsuleUpdateCoinConfig)
  203. e.POST("/live.liveadmin.v1.Capsule/update_coin_status", capsuleUpdateCoinStatus)
  204. e.POST("/live.liveadmin.v1.Capsule/delete_coin", capsuleDeleteCoin)
  205. e.GET("/live.liveadmin.v1.Capsule/get_pool_list", capsuleGetPoolList)
  206. e.POST("/live.liveadmin.v1.Capsule/update_pool", capsuleUpdatePool)
  207. e.POST("/live.liveadmin.v1.Capsule/delete_pool", capsuleDeletePool)
  208. e.POST("/live.liveadmin.v1.Capsule/update_pool_status", capsuleUpdatePoolStatus)
  209. e.GET("/live.liveadmin.v1.Capsule/get_pool_prize", capsuleGetPoolPrize)
  210. e.GET("/live.liveadmin.v1.Capsule/get_prize_type", capsuleGetPrizeType)
  211. e.GET("/live.liveadmin.v1.Capsule/get_prize_expire", capsuleGetPrizeExpire)
  212. e.POST("/live.liveadmin.v1.Capsule/update_pool_prize", capsuleUpdatePoolPrize)
  213. e.POST("/live.liveadmin.v1.Capsule/delete_pool_prize", capsuleDeletePoolPrize)
  214. e.GET("/live.liveadmin.v1.Capsule/get_coupon_list", capsuleGetCouponList)
  215. }