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

74 lines
2.2 KiB
Go

// Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
// source: api/http/v1/relation.pb
/*
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/http/v1/relation.pb
*/
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
// ==================
// Relation Interface
// ==================
// Index 相关服务
type Relation interface {
// [app端关注二级页][全量]正在直播接口
// `midware:"guest"`
LiveAnchor(ctx context.Context, req *LiveAnchorReq) (resp *LiveAnchorResp, err error)
// [app端关注二级页][分页]暂未开播接口
// `midware:"guest"`
UnliveAnchor(ctx context.Context, req *UnLiveAnchorReq) (resp *UnLiveAnchorResp, err error)
}
var v1RelationSvc Relation
// @params LiveAnchorReq
// @router GET /xlive/app-interface/v1/relation/liveAnchor
// @response LiveAnchorResp
func relationLiveAnchor(c *bm.Context) {
p := new(LiveAnchorReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1RelationSvc.LiveAnchor(c, p)
c.JSON(resp, err)
}
// @params UnLiveAnchorReq
// @router GET /xlive/app-interface/v1/relation/unliveAnchor
// @response UnLiveAnchorResp
func relationUnliveAnchor(c *bm.Context) {
p := new(UnLiveAnchorReq)
if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
return
}
resp, err := v1RelationSvc.UnliveAnchor(c, p)
c.JSON(resp, err)
}
// RegisterV1RelationService Register the blademaster route with middleware map
// midMap is the middleware map, the key is defined in proto
func RegisterV1RelationService(e *bm.Engine, svc Relation, midMap map[string]bm.HandlerFunc) {
guest := midMap["guest"]
v1RelationSvc = svc
e.GET("/xlive/app-interface/v1/relation/liveAnchor", guest, relationLiveAnchor)
e.GET("/xlive/app-interface/v1/relation/unliveAnchor", guest, relationUnliveAnchor)
}