41 lines
1.0 KiB
Go
41 lines
1.0 KiB
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 errdata = this.OtherInfoCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
if info, err = this.module.modelArena.queryPlayerInfo(req.OtherId); err != nil && err != mgo.MongodbNil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_DBError,
|
|
Title: pb.ErrorCode_DBError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
|
|
session.SendMsg(string(this.module.GetType()), "otherinfo", &pb.ArenaOtherInfoResp{Info: info})
|
|
return
|
|
}
|