From 25a85220ba84ad6c379ff8b791287122236788bf Mon Sep 17 00:00:00 2001 From: lee <332870766@qq.com> Date: Wed, 10 Jul 2024 17:12:25 +0800 Subject: [PATCH] =?UTF-8?q?2024.7.10=20=E6=96=B0=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E5=AE=98=E7=BD=91=20=E5=AD=97=E5=85=B8=E5=80=92=E5=BA=8F?= =?UTF-8?q?=EF=BC=8C=E7=BD=91=E7=AB=99=E6=8E=A5=E5=8F=A3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/system/DoorController.java | 67 +++++++++++++++++++ .../system/XysArticleController.java | 8 +-- .../mapper/system/SysDictTypeMapper.xml | 25 +++---- ruoyi-ui/src/views/system/img/index.vue | 18 ++++- 4 files changed, 100 insertions(+), 18 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DoorController.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DoorController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DoorController.java new file mode 100644 index 0000000..b5a1b4e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/DoorController.java @@ -0,0 +1,67 @@ +package com.ruoyi.web.controller.system; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.utils.sign.Base64; +import com.ruoyi.system.domain.XysArticle; +import com.ruoyi.system.domain.XysImg; +import com.ruoyi.system.service.IXysArticleService; +import com.ruoyi.system.service.IXysImgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 門戶Controller + * + * @author libao + * @date 2024-07-08 + */ +@RestController +@RequestMapping("/door") +public class DoorController extends BaseController +{ + @Autowired + private IXysArticleService xysArticleService; + @Autowired + private IXysImgService xysImgService; + + /** + * 查询文章列表 + */ + @GetMapping("/getArticleList") + public TableDataInfo getArticleList(XysArticle xysArticle) + { + startPage(); + List list = xysArticleService.selectXysArticleList(xysArticle); + return getDataTable(list); + } + + /** + * 查询图片列表 + */ + @GetMapping("/getImgList") + public TableDataInfo getImgList(XysImg xysImg) + { + startPage(); + List list = xysImgService.selectXysImgList(xysImg); + return getDataTable(list); + } + + /** + * 获取文章管理详细信息 + */ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(xysArticleService.selectXysArticleById(id)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XysArticleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XysArticleController.java index 630456e..38fb15d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XysArticleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XysArticleController.java @@ -79,8 +79,8 @@ public class XysArticleController extends BaseController @PostMapping public AjaxResult add(@RequestBody XysArticle xysArticle) { - String content = new String(Base64.decode(xysArticle.getContent())); - xysArticle.setContent(content); +// String content = new String(Base64.decode(xysArticle.getContent())); +// xysArticle.setContent(content); return toAjax(xysArticleService.insertXysArticle(xysArticle)); } @@ -92,8 +92,8 @@ public class XysArticleController extends BaseController @PutMapping public AjaxResult edit(@RequestBody XysArticle xysArticle) { - String content = new String(Base64.decode(xysArticle.getContent())); - xysArticle.setContent(content); +// String content = new String(Base64.decode(xysArticle.getContent())); +// xysArticle.setContent(content); return toAjax(xysArticleService.updateXysArticle(xysArticle)); } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml index 55b4075..28cf8cb 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -14,9 +14,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - select dict_id, dict_name, dict_type, status, create_by, create_time, remark + select dict_id, dict_name, dict_type, status, create_by, create_time, remark from sys_dict_type @@ -39,36 +39,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + order by create_time desc - + - + - + - + - + delete from sys_dict_type where dict_id = #{dictId} - + delete from sys_dict_type where dict_id in #{dictId} - + @@ -83,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where dict_id = #{dictId} - + insert into sys_dict_type( dict_name, @@ -101,5 +102,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sysdate() ) - - \ No newline at end of file + + diff --git a/ruoyi-ui/src/views/system/img/index.vue b/ruoyi-ui/src/views/system/img/index.vue index 498ddcc..609fd1c 100644 --- a/ruoyi-ui/src/views/system/img/index.vue +++ b/ruoyi-ui/src/views/system/img/index.vue @@ -66,7 +66,11 @@ - + + +