123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
- // source: appUcenter.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:
- appUcenter.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 PathRoomGetInfo = "/live.appucenter.v1.Room/GetInfo"
- var PathRoomCreate = "/live.appucenter.v1.Room/Create"
- var PathTopicGetTopicList = "/live.appucenter.v1.Topic/GetTopicList"
- var PathTopicCheckTopic = "/live.appucenter.v1.Topic/CheckTopic"
- // ==============
- // Room Interface
- // ==============
- type RoomBMServer interface {
- // 获取房间基本信息
- // `method:"GET" midware:"auth"`
- GetInfo(ctx context.Context, req *GetRoomInfoReq) (resp *GetRoomInfoResp, err error)
- // 创建房间
- // `method:"POST" midware:"auth"`
- Create(ctx context.Context, req *CreateReq) (resp *CreateResp, err error)
- }
- var v1RoomSvc RoomBMServer
- func roomGetInfo(c *bm.Context) {
- p := new(GetRoomInfoReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := v1RoomSvc.GetInfo(c, p)
- c.JSON(resp, err)
- }
- func roomCreate(c *bm.Context) {
- p := new(CreateReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := v1RoomSvc.Create(c, p)
- c.JSON(resp, err)
- }
- // RegisterV1RoomService Register the blademaster route with middleware map
- // midMap is the middleware map, the key is defined in proto
- func RegisterV1RoomService(e *bm.Engine, svc RoomBMServer, midMap map[string]bm.HandlerFunc) {
- auth := midMap["auth"]
- v1RoomSvc = svc
- e.GET("/xlive/app-ucenter/v1/room/GetInfo", auth, roomGetInfo)
- e.POST("/xlive/app-ucenter/v1/room/Create", auth, roomCreate)
- }
- // RegisterRoomBMServer Register the blademaster route
- func RegisterRoomBMServer(e *bm.Engine, server RoomBMServer) {
- v1RoomSvc = server
- e.GET("/live.appucenter.v1.Room/GetInfo", roomGetInfo)
- e.POST("/live.appucenter.v1.Room/Create", roomCreate)
- }
- // ===============
- // Topic Interface
- // ===============
- type TopicBMServer interface {
- // 获取话题列表
- // `method:"GET" midware:"auth"`
- GetTopicList(ctx context.Context, req *GetTopicListReq) (resp *GetTopicListResp, err error)
- // 检验话题是否有效
- // `method:"GET" midware:"auth"`
- CheckTopic(ctx context.Context, req *CheckTopicReq) (resp *CheckTopicResp, err error)
- }
- var v1TopicSvc TopicBMServer
- func topicGetTopicList(c *bm.Context) {
- p := new(GetTopicListReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := v1TopicSvc.GetTopicList(c, p)
- c.JSON(resp, err)
- }
- func topicCheckTopic(c *bm.Context) {
- p := new(CheckTopicReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := v1TopicSvc.CheckTopic(c, p)
- c.JSON(resp, err)
- }
- // RegisterV1TopicService Register the blademaster route with middleware map
- // midMap is the middleware map, the key is defined in proto
- func RegisterV1TopicService(e *bm.Engine, svc TopicBMServer, midMap map[string]bm.HandlerFunc) {
- auth := midMap["auth"]
- v1TopicSvc = svc
- e.GET("/xlive/app-ucenter/v1/topic/GetTopicList", auth, topicGetTopicList)
- e.GET("/xlive/app-ucenter/v1/topic/CheckTopic", auth, topicCheckTopic)
- }
- // RegisterTopicBMServer Register the blademaster route
- func RegisterTopicBMServer(e *bm.Engine, server TopicBMServer) {
- v1TopicSvc = server
- e.GET("/live.appucenter.v1.Topic/GetTopicList", topicGetTopicList)
- e.GET("/live.appucenter.v1.Topic/CheckTopic", topicCheckTopic)
- }
|