api.bm.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: api.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. api.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 PathCapsuleGetDetail = "/live.xlottery.v1.Capsule/get_detail"
  20. var PathCapsuleOpenCapsule = "/live.xlottery.v1.Capsule/open_capsule"
  21. var PathCapsuleGetCoinList = "/live.xlottery.v1.Capsule/get_coin_list"
  22. var PathCapsuleUpdateCoinConfig = "/live.xlottery.v1.Capsule/update_coin_config"
  23. var PathCapsuleUpdateCoinStatus = "/live.xlottery.v1.Capsule/update_coin_status"
  24. var PathCapsuleDeleteCoin = "/live.xlottery.v1.Capsule/delete_coin"
  25. var PathCapsuleGetPoolList = "/live.xlottery.v1.Capsule/get_pool_list"
  26. var PathCapsuleUpdatePool = "/live.xlottery.v1.Capsule/update_pool"
  27. var PathCapsuleDeletePool = "/live.xlottery.v1.Capsule/delete_pool"
  28. var PathCapsuleUpdatePoolStatus = "/live.xlottery.v1.Capsule/update_pool_status"
  29. var PathCapsuleGetPoolPrize = "/live.xlottery.v1.Capsule/get_pool_prize"
  30. var PathCapsuleGetPrizeType = "/live.xlottery.v1.Capsule/get_prize_type"
  31. var PathCapsuleGetPrizeExpire = "/live.xlottery.v1.Capsule/get_prize_expire"
  32. var PathCapsuleUpdatePoolPrize = "/live.xlottery.v1.Capsule/update_pool_prize"
  33. var PathCapsuleDeletePoolPrize = "/live.xlottery.v1.Capsule/delete_pool_prize"
  34. var PathCapsuleGetCapsuleInfo = "/live.xlottery.v1.Capsule/get_capsule_info"
  35. var PathCapsuleOpenCapsuleByType = "/live.xlottery.v1.Capsule/open_capsule_by_type"
  36. var PathCapsuleGetCouponList = "/live.xlottery.v1.Capsule/get_coupon_list"
  37. var PathStormStart = "/live.xlottery.v1.Storm/Start"
  38. var PathStormCanStart = "/live.xlottery.v1.Storm/CanStart"
  39. var PathStormJoin = "/live.xlottery.v1.Storm/Join"
  40. var PathStormCheck = "/live.xlottery.v1.Storm/Check"
  41. // =================
  42. // Capsule Interface
  43. // =================
  44. type CapsuleBMServer interface {
  45. GetDetail(ctx context.Context, req *CapsuleGetDetailReq) (resp *CapsuleGetDetailResp, err error)
  46. OpenCapsule(ctx context.Context, req *CapsuleOpenCapsuleReq) (resp *CapsuleOpenCapsuleResp, err error)
  47. GetCoinList(ctx context.Context, req *GetCoinListReq) (resp *GetCoinListResp, err error)
  48. UpdateCoinConfig(ctx context.Context, req *UpdateCoinConfigReq) (resp *UpdateCoinConfigResp, err error)
  49. UpdateCoinStatus(ctx context.Context, req *UpdateCoinStatusReq) (resp *UpdateCoinStatusResp, err error)
  50. DeleteCoin(ctx context.Context, req *DeleteCoinReq) (resp *DeleteCoinResp, err error)
  51. GetPoolList(ctx context.Context, req *GetPoolListReq) (resp *GetPoolListResp, err error)
  52. UpdatePool(ctx context.Context, req *UpdatePoolReq) (resp *UpdatePoolResp, err error)
  53. DeletePool(ctx context.Context, req *DeletePoolReq) (resp *DeletePoolResp, err error)
  54. UpdatePoolStatus(ctx context.Context, req *UpdatePoolStatusReq) (resp *UpdatePoolStatusResp, err error)
  55. GetPoolPrize(ctx context.Context, req *GetPoolPrizeReq) (resp *GetPoolPrizeResp, err error)
  56. GetPrizeType(ctx context.Context, req *GetPrizeTypeReq) (resp *GetPrizeTypeResp, err error)
  57. GetPrizeExpire(ctx context.Context, req *GetPrizeExpireReq) (resp *GetPrizeExpireResp, err error)
  58. UpdatePoolPrize(ctx context.Context, req *UpdatePoolPrizeReq) (resp *UpdatePoolPrizeResp, err error)
  59. DeletePoolPrize(ctx context.Context, req *DeletePoolPrizeReq) (resp *DeletePoolPrizeResp, err error)
  60. GetCapsuleInfo(ctx context.Context, req *CapsuleGetCapsuleInfoReq) (resp *CapsuleGetCapsuleInfoResp, err error)
  61. OpenCapsuleByType(ctx context.Context, req *CapsuleOpenCapsuleByTypeReq) (resp *CapsuleOpenCapsuleByTypeResp, err error)
  62. GetCouponList(ctx context.Context, req *CapsuleGetCouponListReq) (resp *CapsuleGetCouponListResp, err error)
  63. }
  64. var v1CapsuleSvc CapsuleBMServer
  65. func capsuleGetDetail(c *bm.Context) {
  66. p := new(CapsuleGetDetailReq)
  67. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  68. return
  69. }
  70. resp, err := v1CapsuleSvc.GetDetail(c, p)
  71. c.JSON(resp, err)
  72. }
  73. func capsuleOpenCapsule(c *bm.Context) {
  74. p := new(CapsuleOpenCapsuleReq)
  75. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  76. return
  77. }
  78. resp, err := v1CapsuleSvc.OpenCapsule(c, p)
  79. c.JSON(resp, err)
  80. }
  81. func capsuleGetCoinList(c *bm.Context) {
  82. p := new(GetCoinListReq)
  83. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  84. return
  85. }
  86. resp, err := v1CapsuleSvc.GetCoinList(c, p)
  87. c.JSON(resp, err)
  88. }
  89. func capsuleUpdateCoinConfig(c *bm.Context) {
  90. p := new(UpdateCoinConfigReq)
  91. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  92. return
  93. }
  94. resp, err := v1CapsuleSvc.UpdateCoinConfig(c, p)
  95. c.JSON(resp, err)
  96. }
  97. func capsuleUpdateCoinStatus(c *bm.Context) {
  98. p := new(UpdateCoinStatusReq)
  99. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  100. return
  101. }
  102. resp, err := v1CapsuleSvc.UpdateCoinStatus(c, p)
  103. c.JSON(resp, err)
  104. }
  105. func capsuleDeleteCoin(c *bm.Context) {
  106. p := new(DeleteCoinReq)
  107. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  108. return
  109. }
  110. resp, err := v1CapsuleSvc.DeleteCoin(c, p)
  111. c.JSON(resp, err)
  112. }
  113. func capsuleGetPoolList(c *bm.Context) {
  114. p := new(GetPoolListReq)
  115. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  116. return
  117. }
  118. resp, err := v1CapsuleSvc.GetPoolList(c, p)
  119. c.JSON(resp, err)
  120. }
  121. func capsuleUpdatePool(c *bm.Context) {
  122. p := new(UpdatePoolReq)
  123. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  124. return
  125. }
  126. resp, err := v1CapsuleSvc.UpdatePool(c, p)
  127. c.JSON(resp, err)
  128. }
  129. func capsuleDeletePool(c *bm.Context) {
  130. p := new(DeletePoolReq)
  131. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  132. return
  133. }
  134. resp, err := v1CapsuleSvc.DeletePool(c, p)
  135. c.JSON(resp, err)
  136. }
  137. func capsuleUpdatePoolStatus(c *bm.Context) {
  138. p := new(UpdatePoolStatusReq)
  139. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  140. return
  141. }
  142. resp, err := v1CapsuleSvc.UpdatePoolStatus(c, p)
  143. c.JSON(resp, err)
  144. }
  145. func capsuleGetPoolPrize(c *bm.Context) {
  146. p := new(GetPoolPrizeReq)
  147. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  148. return
  149. }
  150. resp, err := v1CapsuleSvc.GetPoolPrize(c, p)
  151. c.JSON(resp, err)
  152. }
  153. func capsuleGetPrizeType(c *bm.Context) {
  154. p := new(GetPrizeTypeReq)
  155. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  156. return
  157. }
  158. resp, err := v1CapsuleSvc.GetPrizeType(c, p)
  159. c.JSON(resp, err)
  160. }
  161. func capsuleGetPrizeExpire(c *bm.Context) {
  162. p := new(GetPrizeExpireReq)
  163. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  164. return
  165. }
  166. resp, err := v1CapsuleSvc.GetPrizeExpire(c, p)
  167. c.JSON(resp, err)
  168. }
  169. func capsuleUpdatePoolPrize(c *bm.Context) {
  170. p := new(UpdatePoolPrizeReq)
  171. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  172. return
  173. }
  174. resp, err := v1CapsuleSvc.UpdatePoolPrize(c, p)
  175. c.JSON(resp, err)
  176. }
  177. func capsuleDeletePoolPrize(c *bm.Context) {
  178. p := new(DeletePoolPrizeReq)
  179. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  180. return
  181. }
  182. resp, err := v1CapsuleSvc.DeletePoolPrize(c, p)
  183. c.JSON(resp, err)
  184. }
  185. func capsuleGetCapsuleInfo(c *bm.Context) {
  186. p := new(CapsuleGetCapsuleInfoReq)
  187. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  188. return
  189. }
  190. resp, err := v1CapsuleSvc.GetCapsuleInfo(c, p)
  191. c.JSON(resp, err)
  192. }
  193. func capsuleOpenCapsuleByType(c *bm.Context) {
  194. p := new(CapsuleOpenCapsuleByTypeReq)
  195. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  196. return
  197. }
  198. resp, err := v1CapsuleSvc.OpenCapsuleByType(c, p)
  199. c.JSON(resp, err)
  200. }
  201. func capsuleGetCouponList(c *bm.Context) {
  202. p := new(CapsuleGetCouponListReq)
  203. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  204. return
  205. }
  206. resp, err := v1CapsuleSvc.GetCouponList(c, p)
  207. c.JSON(resp, err)
  208. }
  209. // RegisterCapsuleBMServer Register the blademaster route
  210. func RegisterCapsuleBMServer(e *bm.Engine, server CapsuleBMServer) {
  211. v1CapsuleSvc = server
  212. e.GET("/live.xlottery.v1.Capsule/get_detail", capsuleGetDetail)
  213. e.GET("/live.xlottery.v1.Capsule/open_capsule", capsuleOpenCapsule)
  214. e.GET("/live.xlottery.v1.Capsule/get_coin_list", capsuleGetCoinList)
  215. e.GET("/live.xlottery.v1.Capsule/update_coin_config", capsuleUpdateCoinConfig)
  216. e.GET("/live.xlottery.v1.Capsule/update_coin_status", capsuleUpdateCoinStatus)
  217. e.GET("/live.xlottery.v1.Capsule/delete_coin", capsuleDeleteCoin)
  218. e.GET("/live.xlottery.v1.Capsule/get_pool_list", capsuleGetPoolList)
  219. e.GET("/live.xlottery.v1.Capsule/update_pool", capsuleUpdatePool)
  220. e.GET("/live.xlottery.v1.Capsule/delete_pool", capsuleDeletePool)
  221. e.GET("/live.xlottery.v1.Capsule/update_pool_status", capsuleUpdatePoolStatus)
  222. e.GET("/live.xlottery.v1.Capsule/get_pool_prize", capsuleGetPoolPrize)
  223. e.GET("/live.xlottery.v1.Capsule/get_prize_type", capsuleGetPrizeType)
  224. e.GET("/live.xlottery.v1.Capsule/get_prize_expire", capsuleGetPrizeExpire)
  225. e.GET("/live.xlottery.v1.Capsule/update_pool_prize", capsuleUpdatePoolPrize)
  226. e.GET("/live.xlottery.v1.Capsule/delete_pool_prize", capsuleDeletePoolPrize)
  227. e.GET("/live.xlottery.v1.Capsule/get_capsule_info", capsuleGetCapsuleInfo)
  228. e.GET("/live.xlottery.v1.Capsule/open_capsule_by_type", capsuleOpenCapsuleByType)
  229. e.GET("/live.xlottery.v1.Capsule/get_coupon_list", capsuleGetCouponList)
  230. }
  231. // ===============
  232. // Storm Interface
  233. // ===============
  234. // 节奏风暴 服务
  235. type StormBMServer interface {
  236. // 开启节奏风暴
  237. Start(ctx context.Context, req *StartStormReq) (resp *StartStormResp, err error)
  238. // 节奏风暴是否能开启
  239. CanStart(ctx context.Context, req *StartStormReq) (resp *CanStartStormResp, err error)
  240. // 加入节奏风暴
  241. Join(ctx context.Context, req *JoinStormReq) (resp *JoinStormResp, err error)
  242. // 检查是否加入节奏风暴
  243. Check(ctx context.Context, req *CheckStormReq) (resp *CheckStormResp, err error)
  244. }
  245. var v1StormSvc StormBMServer
  246. func stormStart(c *bm.Context) {
  247. p := new(StartStormReq)
  248. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  249. return
  250. }
  251. resp, err := v1StormSvc.Start(c, p)
  252. c.JSON(resp, err)
  253. }
  254. func stormCanStart(c *bm.Context) {
  255. p := new(StartStormReq)
  256. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  257. return
  258. }
  259. resp, err := v1StormSvc.CanStart(c, p)
  260. c.JSON(resp, err)
  261. }
  262. func stormJoin(c *bm.Context) {
  263. p := new(JoinStormReq)
  264. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  265. return
  266. }
  267. resp, err := v1StormSvc.Join(c, p)
  268. c.JSON(resp, err)
  269. }
  270. func stormCheck(c *bm.Context) {
  271. p := new(CheckStormReq)
  272. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  273. return
  274. }
  275. resp, err := v1StormSvc.Check(c, p)
  276. c.JSON(resp, err)
  277. }
  278. // RegisterStormBMServer Register the blademaster route
  279. func RegisterStormBMServer(e *bm.Engine, server StormBMServer) {
  280. v1StormSvc = server
  281. e.GET("/live.xlottery.v1.Storm/Start", stormStart)
  282. e.GET("/live.xlottery.v1.Storm/CanStart", stormCanStart)
  283. e.GET("/live.xlottery.v1.Storm/Join", stormJoin)
  284. e.GET("/live.xlottery.v1.Storm/Check", stormCheck)
  285. }