package island import ( "go_dreamfactory/comm" "go_dreamfactory/pb" ) // 参数校验 func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.IsLandBuyReq) (errdata *pb.ErrorData) { return } // /获取自己的排行榜信息 func (this *apiComp) Buy(session comm.IUserSession, req *pb.IsLandBuyReq) (errdata *pb.ErrorData) { var ( info *pb.DBIsland heros []*pb.DBHero err error ) if errdata = this.BuyCheck(session, req); errdata != nil { return } if info, err = this.module.model.getmodel(session.GetUserId()); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), } return } if heros, err = this.module.modelhero.getHeroList(session.GetUserId()); err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_DBError, Message: err.Error(), } return } session.SendMsg(string(this.module.GetType()), "info", &pb.IsLandInfoResp{Info: info, Heros: heros}) return }