go-common/app/admin/live/live-admin/api/http/v1/payGoods.bm.go
2019-04-22 18:49:16 +08:00

119 lines
3.9 KiB
Go

// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: payGoods.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:
payGoods.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 PathPayGoodsAdd = "/live.liveadmin.v1.PayGoods/add"
var PathPayGoodsUpdate = "/live.liveadmin.v1.PayGoods/update"
var PathPayGoodsGetList = "/live.liveadmin.v1.PayGoods/getList"
var PathPayGoodsClose = "/live.liveadmin.v1.PayGoods/close"
var PathPayGoodsOpen = "/live.liveadmin.v1.PayGoods/open"
// ==================
// PayGoods Interface
// ==================
type PayGoodsBMServer interface {
// `method:"POST" internal:"true"` 生成一张付费直播票
Add(ctx context.Context, req *PayGoodsAddReq) (resp *PayGoodsAddResp, err error)
// `method:"POST" internal:"true"` 更新一张付费直播票
Update(ctx context.Context, req *PayGoodsUpdateReq) (resp *PayGoodsUpdateResp, err error)
// `internal:"true"` 获取付费直播票列表
GetList(ctx context.Context, req *PayGoodsGetListReq) (resp *PayGoodsGetListResp, err error)
// `method:"POST" internal:"true"` 关闭购票
Close(ctx context.Context, req *PayGoodsCloseReq) (resp *PayGoodsCloseResp, err error)
// `method:"POST" internal:"true"` 开启购票
Open(ctx context.Context, req *PayGoodsOpenReq) (resp *PayGoodsOpenResp, err error)
}
var v1PayGoodsSvc PayGoodsBMServer
func payGoodsAdd(c *bm.Context) {
p := new(PayGoodsAddReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1PayGoodsSvc.Add(c, p)
c.JSON(resp, err)
}
func payGoodsUpdate(c *bm.Context) {
p := new(PayGoodsUpdateReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1PayGoodsSvc.Update(c, p)
c.JSON(resp, err)
}
func payGoodsGetList(c *bm.Context) {
p := new(PayGoodsGetListReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1PayGoodsSvc.GetList(c, p)
c.JSON(resp, err)
}
func payGoodsClose(c *bm.Context) {
p := new(PayGoodsCloseReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1PayGoodsSvc.Close(c, p)
c.JSON(resp, err)
}
func payGoodsOpen(c *bm.Context) {
p := new(PayGoodsOpenReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1PayGoodsSvc.Open(c, p)
c.JSON(resp, err)
}
// RegisterV1PayGoodsService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1PayGoodsService(e *bm.Engine, svc PayGoodsBMServer, midMap map[string]bm.HandlerFunc) {
v1PayGoodsSvc = svc
e.POST("/xlive/internal/live-admin/v1/payGoods/add", payGoodsAdd)
e.POST("/xlive/internal/live-admin/v1/payGoods/update", payGoodsUpdate)
e.GET("/xlive/internal/live-admin/v1/payGoods/getList", payGoodsGetList)
e.POST("/xlive/internal/live-admin/v1/payGoods/close", payGoodsClose)
e.POST("/xlive/internal/live-admin/v1/payGoods/open", payGoodsOpen)
}
// RegisterPayGoodsBMServer Register the blademaster route
func RegisterPayGoodsBMServer(e *bm.Engine, server PayGoodsBMServer) {
v1PayGoodsSvc = server
e.POST("/live.liveadmin.v1.PayGoods/add", payGoodsAdd)
e.POST("/live.liveadmin.v1.PayGoods/update", payGoodsUpdate)
e.GET("/live.liveadmin.v1.PayGoods/getList", payGoodsGetList)
e.POST("/live.liveadmin.v1.PayGoods/close", payGoodsClose)
e.POST("/live.liveadmin.v1.PayGoods/open", payGoodsOpen)
}