go_dreamfactory/modules/arena/api_otherinfo.go
2023-04-14 12:21:58 +08:00

34 lines
863 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) (code pb.ErrorCode) {
if req.OtherId == "" {
code = pb.ErrorCode_ReqParameterError
}
return
}
///获取自己的排行榜信息
func (this *apiComp) OtherInfo(session comm.IUserSession, req *pb.ArenaOtherInfoReq) (code pb.ErrorCode, data *pb.ErrorData) {
var (
info *pb.DBArenaUser
err error
)
if code = this.OtherInfoCheck(session, req); code != pb.ErrorCode_Success {
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
}