go_dreamfactory/modules/practice/api_getgymbuff.go
2023-03-14 16:20:50 +08:00

36 lines
922 B
Go

package practice
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetGymBuffCheck(session comm.IUserSession, req *pb.PracticeGetGymBuffReq) (code pb.ErrorCode) {
return
}
///练功请求
func (this *apiComp) GetGymBuff(session comm.IUserSession, req *pb.PracticeGetGymBuffReq) (code pb.ErrorCode, data proto.Message) {
var (
mryl *cfg.GamePandamasMrylData
buff *cfg.GamePandamasBuffData
err error
)
if mryl, err = this.module.configure.getPandamasMryl(req.Posture); err != nil {
code = pb.ErrorCode_ConfigNoFound
return
}
if buff, err = this.module.configure.getGamePandamasBuff(mryl.BuffGroup); err != nil {
code = pb.ErrorCode_ConfigNoFound
return
}
session.SendMsg(string(this.module.GetType()), "getgymbuff", &pb.PracticeGetGymBuffResp{Buffid: buff.Id})
return
}