go_dreamfactory/modules/arena/api_otherinfo.go
2023-06-06 10:11:23 +08:00

37 lines
923 B
Go

package arena
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/sys/mgo"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) OtherInfoCheck(session comm.IUserSession, req *pb.ArenaOtherInfoReq) (errdata *pb.ErrorData) {
if req.OtherId == "" {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
}
}
return
}
///获取自己的排行榜信息
func (this *apiComp) OtherInfo(session comm.IUserSession, req *pb.ArenaOtherInfoReq) (errdata *pb.ErrorData) {
var (
info *pb.DBArenaUser
err error
)
if code = this.OtherInfoCheck(session, req); errdata != nil {
return
}
if info, err = this.module.modelArena.queryPlayerInfo(req.OtherId); err != nil && err != mgo.MongodbNil {
code = pb.ErrorCode_DBError
return
}
session.SendMsg(string(this.module.GetType()), "otherinfo", &pb.ArenaOtherInfoResp{Info: info})
return
}