116 lines
3.5 KiB
Go
116 lines
3.5 KiB
Go
|
// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
|
||
|
// source: api/grpc/v1/titans.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/titans.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
|
||
|
|
||
|
// ================
|
||
|
// Titans Interface
|
||
|
// ================
|
||
|
|
||
|
type Titans interface {
|
||
|
// 获取team下某个keyword的配置 `internal:"true"`
|
||
|
GetConfigByKeyword(ctx context.Context, req *GetConfigReq) (resp *GetConfigResp, err error)
|
||
|
|
||
|
// 设置team下某个keyword配置 `internal:"true"`
|
||
|
SetConfigByKeyword(ctx context.Context, req *SetConfigReq) (resp *SetConfigResp, err error)
|
||
|
|
||
|
// 管理后台根据条件获取配置 `internal:"true"`
|
||
|
GetConfigsByParams(ctx context.Context, req *ParamsConfigReq) (resp *ParamsConfigResp, err error)
|
||
|
|
||
|
// 获取discover_id对应的全部配置 `internal:"true"`
|
||
|
GetByTreeId(ctx context.Context, req *TreeIdReq) (resp *TreeIdResp, err error)
|
||
|
|
||
|
// 获取多个team或索引的的全部配置 `internal:"true"`
|
||
|
GetConfigsByLikes(ctx context.Context, req *LikesConfigReq) (resp *LikesConfigResp, err error)
|
||
|
}
|
||
|
|
||
|
var v1TitansSvc Titans
|
||
|
|
||
|
// @params GetConfigReq
|
||
|
// @router GET /xlive/internal/resource/v1/titans/get_config_by_keyword
|
||
|
// @response GetConfigResp
|
||
|
func titansGetConfigByKeyword(c *bm.Context) {
|
||
|
p := new(GetConfigReq)
|
||
|
if err := c.Bind(p); err != nil {
|
||
|
return
|
||
|
}
|
||
|
resp, err := v1TitansSvc.GetConfigByKeyword(c, p)
|
||
|
c.JSON(resp, err)
|
||
|
}
|
||
|
|
||
|
// @params SetConfigReq
|
||
|
// @router GET /xlive/internal/resource/v1/titans/set_config_by_keyword
|
||
|
// @response SetConfigResp
|
||
|
func titansSetConfigByKeyword(c *bm.Context) {
|
||
|
p := new(SetConfigReq)
|
||
|
if err := c.Bind(p); err != nil {
|
||
|
return
|
||
|
}
|
||
|
resp, err := v1TitansSvc.SetConfigByKeyword(c, p)
|
||
|
c.JSON(resp, err)
|
||
|
}
|
||
|
|
||
|
// @params ParamsConfigReq
|
||
|
// @router GET /xlive/internal/resource/v1/titans/get_configs_by_params
|
||
|
// @response ParamsConfigResp
|
||
|
func titansGetConfigsByParams(c *bm.Context) {
|
||
|
p := new(ParamsConfigReq)
|
||
|
if err := c.Bind(p); err != nil {
|
||
|
return
|
||
|
}
|
||
|
resp, err := v1TitansSvc.GetConfigsByParams(c, p)
|
||
|
c.JSON(resp, err)
|
||
|
}
|
||
|
|
||
|
// @params TreeIdReq
|
||
|
// @router GET /xlive/internal/resource/v1/titans/getByTreeId
|
||
|
// @response TreeIdResp
|
||
|
func titansGetByTreeId(c *bm.Context) {
|
||
|
p := new(TreeIdReq)
|
||
|
if err := c.Bind(p); err != nil {
|
||
|
return
|
||
|
}
|
||
|
resp, err := v1TitansSvc.GetByTreeId(c, p)
|
||
|
c.JSON(resp, err)
|
||
|
}
|
||
|
|
||
|
// @params LikesConfigReq
|
||
|
// @router GET /xlive/internal/resource/v1/titans/get_configs_by_likes
|
||
|
// @response LikesConfigResp
|
||
|
func titansGetConfigsByLikes(c *bm.Context) {
|
||
|
p := new(LikesConfigReq)
|
||
|
if err := c.Bind(p); err != nil {
|
||
|
return
|
||
|
}
|
||
|
resp, err := v1TitansSvc.GetConfigsByLikes(c, p)
|
||
|
c.JSON(resp, err)
|
||
|
}
|
||
|
|
||
|
// RegisterV1TitansService Register the blademaster route with middleware map
|
||
|
// midMap is the middleware map, the key is defined in proto
|
||
|
func RegisterV1TitansService(e *bm.Engine, svc Titans, midMap map[string]bm.HandlerFunc) {
|
||
|
v1TitansSvc = svc
|
||
|
e.GET("/xlive/internal/resource/v1/titans/get_config_by_keyword", titansGetConfigByKeyword)
|
||
|
e.GET("/xlive/internal/resource/v1/titans/set_config_by_keyword", titansSetConfigByKeyword)
|
||
|
e.GET("/xlive/internal/resource/v1/titans/get_configs_by_params", titansGetConfigsByParams)
|
||
|
e.GET("/xlive/internal/resource/v1/titans/getByTreeId", titansGetByTreeId)
|
||
|
e.GET("/xlive/internal/resource/v1/titans/get_configs_by_likes", titansGetConfigsByLikes)
|
||
|
}
|