From 5771c822e99c38f0484559f1f68843979f0df24b Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期三, 20 九月 2023 19:12:54 +0800
Subject: [PATCH] 后台代码

---
 cloud-server-other/src/main/java/com/dsh/other/controller/BannerController.java |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 4 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 f4d73c3..c82bfe8 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
@@ -2,7 +2,11 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.dsh.other.entity.Banner;
+import com.dsh.other.entity.FrequentlyAskedQuestions;
+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.vo.questionVo.QuestionSearchVO;
 import com.dsh.other.service.IBannerService;
 import com.dsh.other.util.ResultUtil;
 import io.swagger.annotations.ApiImplicitParam;
@@ -10,10 +14,7 @@
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -30,7 +31,47 @@
     private IBannerService bannerService;
 
 
+    /**
+     * 获取广告管理
+     * @return
+     */
+    @RequestMapping("/base/advertisement/listAll")
+    public List<Banner> listAll(@RequestBody AdvertisementQuery query){
+        return  bannerService.listAll(query);
+    }
+    /**
+     * 上/下架、删除常见问题 state=1为上架 2为下架
+     */
+    @RequestMapping("/base/advertisement/changeState")
+    public Object changeState(@RequestBody AdvertisementChangeStateDTO dto){
+        return bannerService.changeState(dto);
+    }
 
+    /**
+     * 根据id获取广告数据
+     */
+    @RequestMapping("/base/advertisement/getById")
+    public Banner changeState(@RequestBody Integer bannerId){
+        return bannerService.getById(bannerId);
+    }
+
+    /**
+     * 添加广告管理
+     * @return
+     */
+    @RequestMapping("/base/advertisement/addAdvertisement")
+    Object addAdvertisement(@RequestBody Banner banner){
+        return bannerService.save(banner);
+    }
+
+    /**
+     * 修改广告管理
+     * @return
+     */
+    @RequestMapping("/base/advertisement/updateAdvertisement")
+    Object updateAdvertisement(@RequestBody Banner banner){
+        return bannerService.updateById(banner);
+    }
 
     @ResponseBody
     @PostMapping("/base/banner/queryBannerList")

--
Gitblit v1.7.1