go-common/app/service/live/resource/api/grpc/v1/api.bm.go
2019-04-22 18:49:16 +08:00

224 lines
5.9 KiB
Go

// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: api/grpc/v1/api.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:
api/grpc/v1/api.proto
*/
package v1
import (
"context"
bm "go-common/library/net/http/blademaster"
)
// to suppressed 'imported but not used warning'
var _ *bm.Context
var _ context.Context
// ==================
// Resource Interface
// ==================
type Resource interface {
// Add 添加资源接口
Add(ctx context.Context, req *AddReq) (resp *AddResp, err error)
// Add 添加资源接口(不限制位置和平台)
AddEx(ctx context.Context, req *AddReq) (resp *AddResp, err error)
// Edit 编辑资源接口
Edit(ctx context.Context, req *EditReq) (resp *EditResp, err error)
// Offline 下线资源接口
Offline(ctx context.Context, req *OfflineReq) (resp *OfflineResp, err error)
// GetList 获取资源列表
GetList(ctx context.Context, req *GetListReq) (resp *GetListResp, err error)
// 获取平台列表
GetPlatformList(ctx context.Context, req *GetPlatformListReq) (resp *GetPlatformListResp, err error)
// GetListEx 获取资源列表
GetListEx(ctx context.Context, req *GetListExReq) (resp *GetListExResp, err error)
}
var v1ResourceSvc Resource
// @params AddReq
// @router GET /xlive/resource/v1/resource/Add
// @response AddResp
func resourceAdd(c *bm.Context) {
p := new(AddReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.Add(c, p)
c.JSON(resp, err)
}
// @params AddReq
// @router GET /xlive/resource/v1/resource/AddEx
// @response AddResp
func resourceAddEx(c *bm.Context) {
p := new(AddReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.AddEx(c, p)
c.JSON(resp, err)
}
// @params EditReq
// @router GET /xlive/resource/v1/resource/Edit
// @response EditResp
func resourceEdit(c *bm.Context) {
p := new(EditReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.Edit(c, p)
c.JSON(resp, err)
}
// @params OfflineReq
// @router GET /xlive/resource/v1/resource/Offline
// @response OfflineResp
func resourceOffline(c *bm.Context) {
p := new(OfflineReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.Offline(c, p)
c.JSON(resp, err)
}
// @params GetListReq
// @router GET /xlive/resource/v1/resource/GetList
// @response GetListResp
func resourceGetList(c *bm.Context) {
p := new(GetListReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.GetList(c, p)
c.JSON(resp, err)
}
// @params GetPlatformListReq
// @router GET /xlive/resource/v1/resource/GetPlatformList
// @response GetPlatformListResp
func resourceGetPlatformList(c *bm.Context) {
p := new(GetPlatformListReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.GetPlatformList(c, p)
c.JSON(resp, err)
}
// @params GetListExReq
// @router GET /xlive/resource/v1/resource/GetListEx
// @response GetListExResp
func resourceGetListEx(c *bm.Context) {
p := new(GetListExReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1ResourceSvc.GetListEx(c, p)
c.JSON(resp, err)
}
// RegisterV1ResourceService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1ResourceService(e *bm.Engine, svc Resource, midMap map[string]bm.HandlerFunc) {
v1ResourceSvc = svc
e.GET("/xlive/resource/v1/resource/Add", resourceAdd)
e.GET("/xlive/resource/v1/resource/AddEx", resourceAddEx)
e.GET("/xlive/resource/v1/resource/Edit", resourceEdit)
e.GET("/xlive/resource/v1/resource/Offline", resourceOffline)
e.GET("/xlive/resource/v1/resource/GetList", resourceGetList)
e.GET("/xlive/resource/v1/resource/GetPlatformList", resourceGetPlatformList)
e.GET("/xlive/resource/v1/resource/GetListEx", resourceGetListEx)
}
// ================
// Splash Interface
// ================
type Splash interface {
// 获取有效闪屏配置
GetInfo(ctx context.Context, req *GetInfoReq) (resp *GetInfoResp, err error)
}
var v1SplashSvc Splash
// @params GetInfoReq
// @router GET /xlive/resource/v1/splash/GetInfo
// @response GetInfoResp
func splashGetInfo(c *bm.Context) {
p := new(GetInfoReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1SplashSvc.GetInfo(c, p)
c.JSON(resp, err)
}
// RegisterV1SplashService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1SplashService(e *bm.Engine, svc Splash, midMap map[string]bm.HandlerFunc) {
v1SplashSvc = svc
e.GET("/xlive/resource/v1/splash/GetInfo", splashGetInfo)
}
// ================
// Banner Interface
// ================
type Banner interface {
// 获取有效banner配置
GetBlinkBanner(ctx context.Context, req *GetInfoReq) (resp *GetInfoResp, err error)
// 获取有效banner配置
GetBanner(ctx context.Context, req *GetBannerReq) (resp *GetBannerResp, err error)
}
var v1BannerSvc Banner
// @params GetInfoReq
// @router GET /xlive/resource/v1/banner/GetBlinkBanner
// @response GetInfoResp
func bannerGetBlinkBanner(c *bm.Context) {
p := new(GetInfoReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1BannerSvc.GetBlinkBanner(c, p)
c.JSON(resp, err)
}
// @params GetBannerReq
// @router GET /xlive/resource/v1/banner/GetBanner
// @response GetBannerResp
func bannerGetBanner(c *bm.Context) {
p := new(GetBannerReq)
if err := c.Bind(p); err != nil {
return
}
resp, err := v1BannerSvc.GetBanner(c, p)
c.JSON(resp, err)
}
// RegisterV1BannerService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1BannerService(e *bm.Engine, svc Banner, midMap map[string]bm.HandlerFunc) {
v1BannerSvc = svc
e.GET("/xlive/resource/v1/banner/GetBlinkBanner", bannerGetBlinkBanner)
e.GET("/xlive/resource/v1/banner/GetBanner", bannerGetBanner)
}