gift.bm.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: gift.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. gift.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 PathGiftDailyBag = "/live.approom.v1.Gift/daily_bag"
  20. var PathGiftNeedTipRecharge = "/live.approom.v1.Gift/NeedTipRecharge"
  21. var PathGiftTipRechargeAction = "/live.approom.v1.Gift/TipRechargeAction"
  22. var PathGiftGiftConfig = "/live.approom.v1.Gift/gift_config"
  23. // ==============
  24. // Gift Interface
  25. // ==============
  26. type GiftBMServer interface {
  27. // 每日礼包接口
  28. // `midware:"guest"`
  29. DailyBag(ctx context.Context, req *DailyBagReq) (resp *DailyBagResp, err error)
  30. // `midware:"auth"`
  31. NeedTipRecharge(ctx context.Context, req *NeedTipRechargeReq) (resp *NeedTipRechargeResp, err error)
  32. // `midware:"auth" method:"post"`
  33. TipRechargeAction(ctx context.Context, req *TipRechargeActionReq) (resp *TipRechargeActionResp, err error)
  34. // 礼物全量配置
  35. GiftConfig(ctx context.Context, req *GiftConfigReq) (resp *GiftConfigResp, err error)
  36. }
  37. var v1GiftSvc GiftBMServer
  38. func giftDailyBag(c *bm.Context) {
  39. p := new(DailyBagReq)
  40. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  41. return
  42. }
  43. resp, err := v1GiftSvc.DailyBag(c, p)
  44. c.JSON(resp, err)
  45. }
  46. func giftNeedTipRecharge(c *bm.Context) {
  47. p := new(NeedTipRechargeReq)
  48. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  49. return
  50. }
  51. resp, err := v1GiftSvc.NeedTipRecharge(c, p)
  52. c.JSON(resp, err)
  53. }
  54. func giftTipRechargeAction(c *bm.Context) {
  55. p := new(TipRechargeActionReq)
  56. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  57. return
  58. }
  59. resp, err := v1GiftSvc.TipRechargeAction(c, p)
  60. c.JSON(resp, err)
  61. }
  62. func giftGiftConfig(c *bm.Context) {
  63. p := new(GiftConfigReq)
  64. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  65. return
  66. }
  67. resp, err := v1GiftSvc.GiftConfig(c, p)
  68. c.JSON(resp, err)
  69. }
  70. // RegisterV1GiftService Register the blademaster route with middleware map
  71. // midMap is the middleware map, the key is defined in proto
  72. func RegisterV1GiftService(e *bm.Engine, svc GiftBMServer, midMap map[string]bm.HandlerFunc) {
  73. auth := midMap["auth"]
  74. guest := midMap["guest"]
  75. v1GiftSvc = svc
  76. e.GET("/xlive/app-room/v1/gift/daily_bag", guest, giftDailyBag)
  77. e.GET("/xlive/app-room/v1/gift/NeedTipRecharge", auth, giftNeedTipRecharge)
  78. e.POST("/xlive/app-room/v1/gift/TipRechargeAction", auth, giftTipRechargeAction)
  79. e.GET("/xlive/app-room/v1/gift/gift_config", giftGiftConfig)
  80. }
  81. // RegisterGiftBMServer Register the blademaster route
  82. func RegisterGiftBMServer(e *bm.Engine, server GiftBMServer) {
  83. v1GiftSvc = server
  84. e.GET("/live.approom.v1.Gift/daily_bag", giftDailyBag)
  85. e.GET("/live.approom.v1.Gift/NeedTipRecharge", giftNeedTipRecharge)
  86. e.POST("/live.approom.v1.Gift/TipRechargeAction", giftTipRechargeAction)
  87. e.GET("/live.approom.v1.Gift/gift_config", giftGiftConfig)
  88. }