| | |
| | | try { |
| | | List<Banner> list = bannerService.list(new QueryWrapper<Banner>().eq("position", position).eq("state", 1).orderByAsc("sort")); |
| | | |
| | | List<Banner> list2 = bannerService.list1(position); |
| | | List<BannerVo> list2 = bannerService.list1(position); |
| | | |
| | | List<BannerVo> list1 = new ArrayList<>(); |
| | | for (Banner banner : list2) { |
| | | BannerVo bannerVo = new BannerVo(); |
| | | BeanUtils.copyProperties(banner, bannerVo); |
| | | list1.add(bannerVo); |
| | | } |
| | | return ResultUtil.success(list1); |
| | | // List<BannerVo> list1 = new ArrayList<>(); |
| | | // for (Banner banner : list2) { |
| | | // BannerVo bannerVo = new BannerVo(); |
| | | // BeanUtils.copyProperties(banner, bannerVo); |
| | | // list1.add(bannerVo); |
| | | // } |
| | | return ResultUtil.success(list2); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |