12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
- // source: api/grpc/v1/exp.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/exp.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
- // =================
- // UserExp Interface
- // =================
- // UserExp 相关服务
- type UserExp interface {
- // GetUserExpMulti 获取用户经验与等级信息,支持批量
- GetUserExp(ctx context.Context, req *GetUserExpReq) (resp *GetUserExpResp, err error)
- // AddUserExp 增加用户经验,不支持批量
- AddUserExp(ctx context.Context, req *AddUserExpReq) (resp *AddUserExpResp, err error)
- }
- var v1UserExpSvc UserExp
- // @params GetUserExpReq
- // @router GET /xlive/xuser/v1/userExp/GetUserExp
- // @response GetUserExpResp
- func userExpGetUserExp(c *bm.Context) {
- p := new(GetUserExpReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := v1UserExpSvc.GetUserExp(c, p)
- c.JSON(resp, err)
- }
- // @params AddUserExpReq
- // @router GET /xlive/xuser/v1/userExp/AddUserExp
- // @response AddUserExpResp
- func userExpAddUserExp(c *bm.Context) {
- p := new(AddUserExpReq)
- if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
- return
- }
- resp, err := v1UserExpSvc.AddUserExp(c, p)
- c.JSON(resp, err)
- }
- // RegisterV1UserExpService Register the blademaster route with middleware map
- // midMap is the middleware map, the key is defined in proto
- func RegisterV1UserExpService(e *bm.Engine, svc UserExp, midMap map[string]bm.HandlerFunc) {
- v1UserExpSvc = svc
- e.GET("/xlive/xuser/v1/userExp/GetUserExp", userExpGetUserExp)
- e.GET("/xlive/xuser/v1/userExp/AddUserExp", userExpAddUserExp)
- }
|