go-common/app/admin/live/live-admin/api/http/v1/capsule.bm.go

254 lines
9.8 KiB
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: capsule.proto
/*
Package v1 is a generated blademaster stub package.
This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
It is generated from these files:
capsule.proto
*/
package v1
import (
"context"
bm "go-common/library/net/http/blademaster"
"go-common/library/net/http/blademaster/binding"
)
// to suppressed 'imported but not used warning'
var _ *bm.Context
var _ context.Context
var _ binding.StructValidator
var PathCapsuleGetCoinList = "/live.liveadmin.v1.Capsule/get_coin_list"
var PathCapsuleUpdateCoinConfig = "/live.liveadmin.v1.Capsule/update_coin_config"
var PathCapsuleUpdateCoinStatus = "/live.liveadmin.v1.Capsule/update_coin_status"
var PathCapsuleDeleteCoin = "/live.liveadmin.v1.Capsule/delete_coin"
var PathCapsuleGetPoolList = "/live.liveadmin.v1.Capsule/get_pool_list"
var PathCapsuleUpdatePool = "/live.liveadmin.v1.Capsule/update_pool"
var PathCapsuleDeletePool = "/live.liveadmin.v1.Capsule/delete_pool"
var PathCapsuleUpdatePoolStatus = "/live.liveadmin.v1.Capsule/update_pool_status"
var PathCapsuleGetPoolPrize = "/live.liveadmin.v1.Capsule/get_pool_prize"
var PathCapsuleGetPrizeType = "/live.liveadmin.v1.Capsule/get_prize_type"
var PathCapsuleGetPrizeExpire = "/live.liveadmin.v1.Capsule/get_prize_expire"
var PathCapsuleUpdatePoolPrize = "/live.liveadmin.v1.Capsule/update_pool_prize"
var PathCapsuleDeletePoolPrize = "/live.liveadmin.v1.Capsule/delete_pool_prize"
var PathCapsuleGetCouponList = "/live.liveadmin.v1.Capsule/get_coupon_list"
// =================
// Capsule Interface
// =================
type CapsuleBMServer interface {
// `internal:"true"`
GetCoinList(ctx context.Context, req *GetCoinListReqAdmin) (resp *GetCoinListRespAdmin, err error)
// `method:"POST" internal:"true"`
UpdateCoinConfig(ctx context.Context, req *UpdateCoinConfigReqAdmin) (resp *UpdateCoinConfigRespAdmin, err error)
// `method:"POST" internal:"true"`
UpdateCoinStatus(ctx context.Context, req *UpdateCoinStatusReqAdmin) (resp *UpdateCoinStatusRespAdmin, err error)
// `method:"POST" internal:"true"`
DeleteCoin(ctx context.Context, req *DeleteCoinReqAdmin) (resp *DeleteCoinRespAdmin, err error)
// `internal:"true"`
GetPoolList(ctx context.Context, req *GetPoolListReqAdmin) (resp *GetPoolListRespAdmin, err error)
// `method:"POST" internal:"true"`
UpdatePool(ctx context.Context, req *UpdatePoolReqAdmin) (resp *UpdatePoolRespAdmin, err error)
// `method:"POST" internal:"true"`
DeletePool(ctx context.Context, req *DeletePoolReqAdmin) (resp *DeletePoolRespAdmin, err error)
// `method:"POST" internal:"true"`
UpdatePoolStatus(ctx context.Context, req *UpdatePoolStatusReqAdmin) (resp *UpdatePoolStatusRespAdmin, err error)
// `internal:"true"`
GetPoolPrize(ctx context.Context, req *GetPoolPrizeReqAdmin) (resp *GetPoolPrizeRespAdmin, err error)
// `internal:"true"`
GetPrizeType(ctx context.Context, req *GetPrizeTypeReq) (resp *GetPrizeTypeResp, err error)
// `internal:"true"`
GetPrizeExpire(ctx context.Context, req *GetPrizeExpireReq) (resp *GetPrizeExpireResp, err error)
// `method:"POST" internal:"true"`
UpdatePoolPrize(ctx context.Context, req *UpdatePoolPrizeReqAdmin) (resp *UpdatePoolPrizeRespAdmin, err error)
// `method:"POST" internal:"true" `
DeletePoolPrize(ctx context.Context, req *DeletePoolPrizeReqAdmin) (resp *DeletePoolPrizeRespAdmin, err error)
// `internal:"true"`
GetCouponList(ctx context.Context, req *CapsuleGetCouponListReq) (resp *CapsuleGetCouponListResp, err error)
}
var v1CapsuleSvc CapsuleBMServer
func capsuleGetCoinList(c *bm.Context) {
p := new(GetCoinListReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetCoinList(c, p)
c.JSON(resp, err)
}
func capsuleUpdateCoinConfig(c *bm.Context) {
p := new(UpdateCoinConfigReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.UpdateCoinConfig(c, p)
c.JSON(resp, err)
}
func capsuleUpdateCoinStatus(c *bm.Context) {
p := new(UpdateCoinStatusReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.UpdateCoinStatus(c, p)
c.JSON(resp, err)
}
func capsuleDeleteCoin(c *bm.Context) {
p := new(DeleteCoinReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.DeleteCoin(c, p)
c.JSON(resp, err)
}
func capsuleGetPoolList(c *bm.Context) {
p := new(GetPoolListReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetPoolList(c, p)
c.JSON(resp, err)
}
func capsuleUpdatePool(c *bm.Context) {
p := new(UpdatePoolReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.UpdatePool(c, p)
c.JSON(resp, err)
}
func capsuleDeletePool(c *bm.Context) {
p := new(DeletePoolReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.DeletePool(c, p)
c.JSON(resp, err)
}
func capsuleUpdatePoolStatus(c *bm.Context) {
p := new(UpdatePoolStatusReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.UpdatePoolStatus(c, p)
c.JSON(resp, err)
}
func capsuleGetPoolPrize(c *bm.Context) {
p := new(GetPoolPrizeReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetPoolPrize(c, p)
c.JSON(resp, err)
}
func capsuleGetPrizeType(c *bm.Context) {
p := new(GetPrizeTypeReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetPrizeType(c, p)
c.JSON(resp, err)
}
func capsuleGetPrizeExpire(c *bm.Context) {
p := new(GetPrizeExpireReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetPrizeExpire(c, p)
c.JSON(resp, err)
}
func capsuleUpdatePoolPrize(c *bm.Context) {
p := new(UpdatePoolPrizeReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.UpdatePoolPrize(c, p)
c.JSON(resp, err)
}
func capsuleDeletePoolPrize(c *bm.Context) {
p := new(DeletePoolPrizeReqAdmin)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.DeletePoolPrize(c, p)
c.JSON(resp, err)
}
func capsuleGetCouponList(c *bm.Context) {
p := new(CapsuleGetCouponListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1CapsuleSvc.GetCouponList(c, p)
c.JSON(resp, err)
}
// RegisterV1CapsuleService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1CapsuleService(e *bm.Engine, svc CapsuleBMServer, midMap map[string]bm.HandlerFunc) {
v1CapsuleSvc = svc
e.GET("/xlive/internal/live-admin/v1/capsule/get_coin_list", capsuleGetCoinList)
e.POST("/xlive/internal/live-admin/v1/capsule/update_coin_config", capsuleUpdateCoinConfig)
e.POST("/xlive/internal/live-admin/v1/capsule/update_coin_status", capsuleUpdateCoinStatus)
e.POST("/xlive/internal/live-admin/v1/capsule/delete_coin", capsuleDeleteCoin)
e.GET("/xlive/internal/live-admin/v1/capsule/get_pool_list", capsuleGetPoolList)
e.POST("/xlive/internal/live-admin/v1/capsule/update_pool", capsuleUpdatePool)
e.POST("/xlive/internal/live-admin/v1/capsule/delete_pool", capsuleDeletePool)
e.POST("/xlive/internal/live-admin/v1/capsule/update_pool_status", capsuleUpdatePoolStatus)
e.GET("/xlive/internal/live-admin/v1/capsule/get_pool_prize", capsuleGetPoolPrize)
e.GET("/xlive/internal/live-admin/v1/capsule/get_prize_type", capsuleGetPrizeType)
e.GET("/xlive/internal/live-admin/v1/capsule/get_prize_expire", capsuleGetPrizeExpire)
e.POST("/xlive/internal/live-admin/v1/capsule/update_pool_prize", capsuleUpdatePoolPrize)
e.POST("/xlive/internal/live-admin/v1/capsule/delete_pool_prize", capsuleDeletePoolPrize)
e.GET("/xlive/internal/live-admin/v1/capsule/get_coupon_list", capsuleGetCouponList)
}
// RegisterCapsuleBMServer Register the blademaster route
func RegisterCapsuleBMServer(e *bm.Engine, server CapsuleBMServer) {
v1CapsuleSvc = server
e.GET("/live.liveadmin.v1.Capsule/get_coin_list", capsuleGetCoinList)
e.POST("/live.liveadmin.v1.Capsule/update_coin_config", capsuleUpdateCoinConfig)
e.POST("/live.liveadmin.v1.Capsule/update_coin_status", capsuleUpdateCoinStatus)
e.POST("/live.liveadmin.v1.Capsule/delete_coin", capsuleDeleteCoin)
e.GET("/live.liveadmin.v1.Capsule/get_pool_list", capsuleGetPoolList)
e.POST("/live.liveadmin.v1.Capsule/update_pool", capsuleUpdatePool)
e.POST("/live.liveadmin.v1.Capsule/delete_pool", capsuleDeletePool)
e.POST("/live.liveadmin.v1.Capsule/update_pool_status", capsuleUpdatePoolStatus)
e.GET("/live.liveadmin.v1.Capsule/get_pool_prize", capsuleGetPoolPrize)
e.GET("/live.liveadmin.v1.Capsule/get_prize_type", capsuleGetPrizeType)
e.GET("/live.liveadmin.v1.Capsule/get_prize_expire", capsuleGetPrizeExpire)
e.POST("/live.liveadmin.v1.Capsule/update_pool_prize", capsuleUpdatePoolPrize)
e.POST("/live.liveadmin.v1.Capsule/delete_pool_prize", capsuleDeletePoolPrize)
e.GET("/live.liveadmin.v1.Capsule/get_coupon_list", capsuleGetCouponList)
}