You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
4.9 KiB
133 lines
4.9 KiB
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT. |
|
// source: gaea.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: |
|
gaea.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 PathGaeaGetConfigByKeyword = "/live.liveadmin.v1.gaea/get_config_by_keyword" |
|
var PathGaeaSetConfigByKeyword = "/live.liveadmin.v1.gaea/set_config_by_keyword" |
|
var PathGaeaGetConfigsByParams = "/live.liveadmin.v1.gaea/get_configs_by_params" |
|
var PathGaeaGetConfigsByTeam = "/live.liveadmin.v1.gaea/get_configs_by_team" |
|
var PathGaeaGetConfigsByKeyword = "/live.liveadmin.v1.gaea/get_configs_by_keyword" |
|
var PathGaeaGetConfigsByTeams = "/live.liveadmin.v1.gaea/get_configs_by_teams" |
|
|
|
// ============== |
|
// Gaea Interface |
|
// ============== |
|
|
|
type GaeaBMServer interface { |
|
// 获取team下某个keyword的配置 `internal:"true"` |
|
GetConfigByKeyword(ctx context.Context, req *GetConfigReq) (resp *GetConfigResp, err error) |
|
|
|
// `method:"POST" internal:"true"` 设置team下某个keyword配置 |
|
SetConfigByKeyword(ctx context.Context, req *SetConfigReq) (resp *SetConfigResp, err error) |
|
|
|
// 管理后台根据条件获取配置 `internal:"true"` |
|
GetConfigsByParams(ctx context.Context, req *ParamsConfigReq) (resp *ParamsConfigResp, err error) |
|
|
|
// 获取单个team的全部配置 `internal:"true"` |
|
GetConfigsByTeam(ctx context.Context, req *TeamConfigReq) (resp *TeamConfigResp, err error) |
|
|
|
// 通过keyword获取配置 `internal:"true"` |
|
GetConfigsByKeyword(ctx context.Context, req *GetConfigsReq) (resp *GetConfigsResp, err error) |
|
|
|
// 获取多个team下的全部配置 `internal:"true"` |
|
GetConfigsByTeams(ctx context.Context, req *TeamsConfigReq) (resp *TeamsConfigResp, err error) |
|
} |
|
|
|
var v1GaeaSvc GaeaBMServer |
|
|
|
func gaeaGetConfigByKeyword(c *bm.Context) { |
|
p := new(GetConfigReq) |
|
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil { |
|
return |
|
} |
|
resp, err := v1GaeaSvc.GetConfigByKeyword(c, p) |
|
c.JSON(resp, err) |
|
} |
|
|
|
func gaeaSetConfigByKeyword(c *bm.Context) { |
|
p := new(SetConfigReq) |
|
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil { |
|
return |
|
} |
|
resp, err := v1GaeaSvc.SetConfigByKeyword(c, p) |
|
c.JSON(resp, err) |
|
} |
|
|
|
func gaeaGetConfigsByParams(c *bm.Context) { |
|
p := new(ParamsConfigReq) |
|
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil { |
|
return |
|
} |
|
resp, err := v1GaeaSvc.GetConfigsByParams(c, p) |
|
c.JSON(resp, err) |
|
} |
|
|
|
func gaeaGetConfigsByTeam(c *bm.Context) { |
|
p := new(TeamConfigReq) |
|
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil { |
|
return |
|
} |
|
resp, err := v1GaeaSvc.GetConfigsByTeam(c, p) |
|
c.JSON(resp, err) |
|
} |
|
|
|
func gaeaGetConfigsByKeyword(c *bm.Context) { |
|
p := new(GetConfigsReq) |
|
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil { |
|
return |
|
} |
|
resp, err := v1GaeaSvc.GetConfigsByKeyword(c, p) |
|
c.JSON(resp, err) |
|
} |
|
|
|
func gaeaGetConfigsByTeams(c *bm.Context) { |
|
p := new(TeamsConfigReq) |
|
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil { |
|
return |
|
} |
|
resp, err := v1GaeaSvc.GetConfigsByTeams(c, p) |
|
c.JSON(resp, err) |
|
} |
|
|
|
// RegisterV1GaeaService Register the blademaster route with middleware map |
|
// midMap is the middleware map, the key is defined in proto |
|
func RegisterV1GaeaService(e *bm.Engine, svc GaeaBMServer, midMap map[string]bm.HandlerFunc) { |
|
v1GaeaSvc = svc |
|
e.GET("/xlive/internal/live-admin/v1/gaea/get_config_by_keyword", gaeaGetConfigByKeyword) |
|
e.POST("/xlive/internal/live-admin/v1/gaea/set_config_by_keyword", gaeaSetConfigByKeyword) |
|
e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_params", gaeaGetConfigsByParams) |
|
e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_team", gaeaGetConfigsByTeam) |
|
e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_keyword", gaeaGetConfigsByKeyword) |
|
e.GET("/xlive/internal/live-admin/v1/gaea/get_configs_by_teams", gaeaGetConfigsByTeams) |
|
} |
|
|
|
// RegisterGaeaBMServer Register the blademaster route |
|
func RegisterGaeaBMServer(e *bm.Engine, server GaeaBMServer) { |
|
v1GaeaSvc = server |
|
e.GET("/live.liveadmin.v1.gaea/get_config_by_keyword", gaeaGetConfigByKeyword) |
|
e.POST("/live.liveadmin.v1.gaea/set_config_by_keyword", gaeaSetConfigByKeyword) |
|
e.GET("/live.liveadmin.v1.gaea/get_configs_by_params", gaeaGetConfigsByParams) |
|
e.GET("/live.liveadmin.v1.gaea/get_configs_by_team", gaeaGetConfigsByTeam) |
|
e.GET("/live.liveadmin.v1.gaea/get_configs_by_keyword", gaeaGetConfigsByKeyword) |
|
e.GET("/live.liveadmin.v1.gaea/get_configs_by_teams", gaeaGetConfigsByTeams) |
|
}
|
|
|