From e030255c23c7ba3e2cbad1036a810d6d72fa864f Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期四, 26 十月 2023 18:04:58 +0800 Subject: [PATCH] 修改bug --- cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 37 insertions(+), 14 deletions(-) diff --git a/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java b/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java index bf05b03..daf6a85 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java +++ b/cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java @@ -1,13 +1,11 @@ package com.dsh.other.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.dsh.other.entity.Banner; -import com.dsh.other.entity.FrequentlyAskedQuestions; +import com.dsh.other.entity.*; import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO; import com.dsh.other.feignclient.model.AdvertisementQuery; -import com.dsh.other.entity.CreateHistoryDto; -import com.dsh.other.entity.GetHistoryDto; import com.dsh.other.model.BannerVo; +import com.dsh.other.model.dto.siteDto.SelectDto; import com.dsh.other.model.vo.questionVo.QuestionSearchVO; import com.dsh.other.service.IBannerService; import com.dsh.other.util.ResultUtil; @@ -83,15 +81,37 @@ @ApiImplicitParam(value = "位置(1=首页,2=首页底部,3=线上课得积分,4=看视频得奖励,5=常见问题)", name = "position", dataType = "int", required = true), }) public ResultUtil<List<BannerVo>> queryBannerList(Integer position){ +// try { +// List<Banner> list = bannerService.list(new QueryWrapper<Banner>().eq("position", position).eq("state", 1).orderByAsc("sort")); + +// if (position == 4) { + List<BannerVo> list2 = bannerService.list1(position); + return ResultUtil.success(list2); +// } + +// List<BannerVo> list1 = new ArrayList<>(); +// for (Banner banner : list) { +// BannerVo bannerVo = new BannerVo(); +// BeanUtils.copyProperties(banner, bannerVo); +// list1.add(bannerVo); +// } +// return ResultUtil.success(list1); +// }catch (Exception e){ +// e.printStackTrace(); +// return ResultUtil.runErr(); +// } + } + + + + + @ResponseBody + @PostMapping("/base/banner/index") + @ApiOperation(value = "获取首页图片", tags = {"获取首页图片"}) + public ResultUtil querySiteTimes(){ try { - List<Banner> list = bannerService.list(new QueryWrapper<Banner>().eq("position", position).eq("state", 1).orderByAsc("sort")); - List<BannerVo> list1 = new ArrayList<>(); - for (Banner banner : list) { - BannerVo bannerVo = new BannerVo(); - BeanUtils.copyProperties(banner, bannerVo); - list1.add(bannerVo); - } - return ResultUtil.success(list1); + String result =bannerService.getFirst(); + return ResultUtil.success(result); }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); @@ -112,9 +132,12 @@ @ResponseBody @PostMapping("/class/gethisotory") public List<GetHistoryDto> getHistory(@RequestBody Integer studentId){ + List<GetHistoryDto> list = bannerService.gethistory(studentId); - return bannerService.gethistory(studentId); - + System.out.println("=-======GetHistoryDto========"+list); + return list; } + + } -- Gitblit v1.7.1