go_dreamfactory/modules/arena/api_otherinfo.go
2022-10-27 14:42:33 +08:00

34 lines
842 B
Go

package arena
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) OtherInfoCheck(session comm.IUserSession, req *pb.ArenaOtherInfoReq) (code pb.ErrorCode) {
return
}
///获取自己的排行榜信息
func (this *apiComp) OtherInfo(session comm.IUserSession, req *pb.ArenaOtherInfoReq) (code pb.ErrorCode, data proto.Message) {
var (
info *pb.DBArenaUser
err error
)
if code = this.OtherInfoCheck(session, req); code != pb.ErrorCode_Success {
return
}
if info, err = this.module.modelArena.queryPlayerInfo(session.GetUserId()); err != nil && err != mgo.MongodbNil {
code = pb.ErrorCode_DBError
return
}
session.SendMsg(string(this.module.GetType()), "otherinfo", &pb.ArenaOtherInfoResp{Info: info})
return
}