From 3d1d4d1d0eb561fc5a754ff9c08bc4723a745b56 Mon Sep 17 00:00:00 2001 From: lee <332870766@qq.com> Date: Mon, 26 Aug 2024 08:42:46 +0800 Subject: [PATCH] 2024.8.26 --- .../web/controller/system/DoorController.java | 83 +++++-------------- .../ruoyi/system/mapper/CmsArticleMapper.java | 6 ++ .../service/impl/CmsArticleServiceImpl.java | 8 +- .../mapper/system/CmsArticleMapper.xml | 5 ++ 4 files changed, 38 insertions(+), 64 deletions(-) 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 index 918413d3..c8e51e10 100644 --- 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 @@ -66,6 +66,17 @@ public class DoorController extends BaseController { return getDataTable(list); } + /** + * 查询文章管理列表 + */ + @ApiOperation("查询文章") + @PostMapping("/gwArticleList") + public TableDataInfo gwArticleList(CmsArticle article) { + startPage(); + List list = articleService.selectCmsArticleList(article); + return getDataTable(list); + } + @ApiOperation("文章详情查询") @ApiImplicitParam(name = "id", value = "文章Id", required = true, dataType = "int", paramType = "path", dataTypeClass = String.class) @PostMapping("/getArt/{id}") @@ -88,9 +99,9 @@ public class DoorController extends BaseController { */ @ApiOperation("照片查询") @PostMapping("/MaterialList") - public TableDataInfo list() { + public TableDataInfo list(CmsMaterial cmsMaterial) { // startPage(); - List list = materialMapper.selectCmsMaterialList(new CmsMaterial()); + List list = materialMapper.selectCmsMaterialList(cmsMaterial); return getDataTable(list); } @@ -129,12 +140,14 @@ public class DoorController extends BaseController { @ApiImplicitParam(name = "description", value = "摘要", dataType = "String", dataTypeClass = String.class), @ApiImplicitParam(name = "articleModel", value = "文章模型", dataType = "String", dataTypeClass = String.class) }) - public List searchArticles(@RequestParam(value = "author", required = false) String author, + public TableDataInfo searchArticles(@RequestParam(value = "author", required = false) String author, @RequestParam(value = "title", required = false) String title, @RequestParam(value = "keywords", required = false) String keywords, @RequestParam(value = "description", required = false) String description, @RequestParam(value = "articleModel", required = false) String articleModel) { - return articleMapper.selectArticlesFuzzySearch(author, title, keywords, description, articleModel); + startPage(); + List list = articleMapper.selectArticlesFuzzySearch(author, title, keywords, description, articleModel); + return getDataTable(list); } /** @@ -197,62 +210,12 @@ public class DoorController extends BaseController { } } } - /** - * 查询留言列表 + * 模糊查询首页收索框 */ -// @ApiOperation("查询留言") -// @PostMapping("/Wordslist") -// public TableDataInfo list(CmsLeaveWords cmsLeaveWords) -// { -// startPage(); -// List list = cmsLeaveWordsService.selectCmsLeaveWordsList(cmsLeaveWords); -// return getDataTable(list); -// } - - /** - * 新增保存留言 - */ -// @ApiOperation("新增留言") -// @ApiImplicitParams({ -// @ApiImplicitParam(name = "wordsTheme", value = "留言主题", dataType = "String", dataTypeClass = String.class), -// @ApiImplicitParam(name = "wordsEmil", value = "邮箱", dataType = "String", dataTypeClass = String.class), -// @ApiImplicitParam(name = "wordsCms", value = "留言内容", dataType = "String", dataTypeClass = String.class) -// }) -// @Log(title = "留言", businessType = BusinessType.INSERT) -// @PostMapping("/WordsAdd") -// public AjaxResult addSave(CmsLeaveWords cmsLeaveWords) -// { -// return toAjax(cmsLeaveWordsService.insertCmsLeaveWords(cmsLeaveWords)); -// } - - /** - * 查询团队预约列表 - */ -// @ApiOperation("查询团队预约列表") -// @PostMapping("/MakeAnAppointmentList") -// public TableDataInfo list(CmsMakeAnAppointment cmsMakeAnAppointment) -// { -// startPage(); -// List list = cmsMakeAnAppointmentService.selectCmsMakeAnAppointmentList(cmsMakeAnAppointment); -// return getDataTable(list); -// } - - /** - * 新增保存团队预约 - */ -// @ApiOperation("新增团队预约") -// @ApiImplicitParams({ -// @ApiImplicitParam(name = "makeLinkman", value = "联系人", dataType = "String", dataTypeClass = String.class), -// @ApiImplicitParam(name = "makePhone", value = "手机号", dataType = "String", dataTypeClass = String.class), -// @ApiImplicitParam(name = "makeCompany", value = "单位名称", dataType = "String", dataTypeClass = String.class), -// @ApiImplicitParam(name = "makeDate", value = "预约时间", dataType = "Date", dataTypeClass = Date.class) -// }) -// @Log(title = "团队预约", businessType = BusinessType.INSERT) -// @PostMapping("/MakeAnAppointmentAdd") -// public AjaxResult addSave(CmsMakeAnAppointment cmsMakeAnAppointment) -// { -// return toAjax(cmsMakeAnAppointmentService.insertCmsMakeAnAppointment(cmsMakeAnAppointment)); -// } - + @GetMapping("/getNext") + public AjaxResult getBNext(@RequestParam(value = "id") Long id, + @RequestParam(value = "categoryId") String categoryId) { + return AjaxResult.success(articleMapper.getNext(id,categoryId)); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CmsArticleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CmsArticleMapper.java index 362d8ebd..9e2b44b6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CmsArticleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/CmsArticleMapper.java @@ -85,4 +85,10 @@ public interface CmsArticleMapper * @return */ public Map getArticleContent(String article_id); + + /** + * 下一篇 + */ + CmsArticle getNext(@Param("id") Long id, + @Param("categoryId") String categoryId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CmsArticleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CmsArticleServiceImpl.java index b6a9c529..6c5e7bd1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CmsArticleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CmsArticleServiceImpl.java @@ -227,10 +227,10 @@ public class CmsArticleServiceImpl implements ICmsArticleService public int updateCmsArticle(CmsArticle cmsArticle) { cmsArticle.setUpdateTime(DateUtils.getNowDate()); - if(SecurityUtils.getLoginUser().getUser() != null){ - SysUser user = SecurityUtils.getLoginUser().getUser(); - cmsArticle.setYhid(user.getUserId().toString()); - } +// if(SecurityUtils.getLoginUser().getUser() != null){ +// SysUser user = SecurityUtils.getLoginUser().getUser(); +// cmsArticle.setYhid(user.getUserId().toString()); +// } cmsArticle.setDeleted(0); cmsArticle.setTopFlag(1); cmsArticle.setAvailable(1); diff --git a/ruoyi-system/src/main/resources/mapper/system/CmsArticleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/CmsArticleMapper.xml index 6a24abaa..1739fc26 100644 --- a/ruoyi-system/src/main/resources/mapper/system/CmsArticleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/CmsArticleMapper.xml @@ -251,4 +251,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" id=#{article_id} + +