From 36688cafd4ec450a1cf8055edfb4303c047eb083 Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期一, 23 十月 2023 09:03:12 +0800 Subject: [PATCH] 修改bug --- cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 46 insertions(+), 3 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 c82bfe8..5c317de 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,11 +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.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; @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -82,8 +83,11 @@ public ResultUtil<List<BannerVo>> queryBannerList(Integer position){ 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> list1 = new ArrayList<>(); - for (Banner banner : list) { + for (Banner banner : list2) { BannerVo bannerVo = new BannerVo(); BeanUtils.copyProperties(banner, bannerVo); list1.add(bannerVo); @@ -94,4 +98,43 @@ return ResultUtil.runErr(); } } + + + + + @ResponseBody + @PostMapping("/base/banner/index") + @ApiOperation(value = "获取首页图片", tags = {"获取首页图片"}) + public ResultUtil querySiteTimes(){ + try { + String result =bannerService.getFirst(); + return ResultUtil.success(result); + }catch (Exception e){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } + + + @ResponseBody + @PostMapping("/class/hisotory") + public void createHistory(@RequestBody CreateHistoryDto createHistoryDto){ + createHistoryDto.setDate(new Date()); + + bannerService.createHistory(createHistoryDto); + + + } + + @ResponseBody + @PostMapping("/class/gethisotory") + public List<GetHistoryDto> getHistory(@RequestBody Integer studentId){ + List<GetHistoryDto> list = bannerService.gethistory(studentId); + + System.out.println("=-======GetHistoryDto========"+list); + return list; + + } + + } -- Gitblit v1.7.1