From 0edbc15d102ddcd8ce4001a85583ce920ee22b21 Mon Sep 17 00:00:00 2001
From: nickchange <126672920+nickchange@users.noreply.github.com>
Date: 星期三, 25 十月 2023 09:40:30 +0800
Subject: [PATCH] 10.25
---
cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java | 38 +++++++++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 11 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 7dde961..a317cf5 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,12 +1,9 @@
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;
@@ -86,13 +83,32 @@
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<BannerVo> list1 = new ArrayList<>();
- for (Banner banner : list) {
- BannerVo bannerVo = new BannerVo();
- BeanUtils.copyProperties(banner, bannerVo);
- list1.add(bannerVo);
- }
- return ResultUtil.success(list1);
+
+ 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(list2);
+ }catch (Exception e){
+ e.printStackTrace();
+ 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();
--
Gitblit v1.7.1