From d2a134b97636f5c4ac09fde6552144b0639c45d6 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Thu, 11 Jul 2024 16:38:02 +0800 Subject: [PATCH] 1 --- .../controller/CourseManageController.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java b/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java index aee75a1..9d9c66a 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CourseManageController.java @@ -5,9 +5,7 @@ import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.resource_center.annotation.AnonymousAccess; -import com.sztzjy.resource_center.entity.SysOneCatalog; -import com.sztzjy.resource_center.entity.SysOneCatalogExample; -import com.sztzjy.resource_center.entity.SysResourceAndCourseExample; +import com.sztzjy.resource_center.entity.*; import com.sztzjy.resource_center.mapper.SysOneCatalogMapper; import com.sztzjy.resource_center.mapper.SysResourceAndCourseMapper; import com.sztzjy.resource_center.mapper.SysThreeCatalogMapper; @@ -23,7 +21,6 @@ import org.springframework.web.bind.annotation.*; import java.util.Date; import java.util.List; -import java.util.Map; /** * @Author xcj @@ -79,8 +76,10 @@ public class CourseManageController { @AnonymousAccess @ApiOperation("课程下拉框/资源标签管理展示") @PostMapping("getAllOneCatalogListByDropDown") - public ResultEntity>> getAllOneCatalogListByDropDown() { - return new ResultEntity<>(sysOneCatalogMapper.getAllOneCatalogListByDropDown()); + public ResultEntity> getAllOneCatalogListByDropDown() { + SysOneCatalogExample example = new SysOneCatalogExample(); + List sysOneCatalogs = sysOneCatalogMapper.selectByExample(example); + return new ResultEntity<>(sysOneCatalogs); } @@ -99,16 +98,22 @@ public class CourseManageController { @AnonymousAccess @ApiOperation("章下拉框/资源标签管理展示") @PostMapping("getAllTwoCatalogListByDropDown") - public ResultEntity>> getAllTwoCatalogList(@RequestParam String oneId) { - return new ResultEntity<>(sysTwoCatalogMapper.getAllTwoCatalogList(oneId)); + public ResultEntity> getAllTwoCatalogList(@RequestParam String oneId) { + SysTwoCatalogExample example = new SysTwoCatalogExample(); + example.createCriteria().andOneIdEqualTo(oneId); + List sysTwoCatalogs = sysTwoCatalogMapper.selectByExample(example); + return new ResultEntity<>(sysTwoCatalogs); } @AnonymousAccess @ApiOperation("节下拉框/资源标签管理展示") @PostMapping("getAllThreeCatalogListByDropDown") - public ResultEntity>> getAllThreeCatalogList(@RequestParam String oneId, @RequestParam String twoId) { - return new ResultEntity<>(sysThreeCatalogMapper.getAllThreeCatalogList(oneId, twoId)); + public ResultEntity> getAllThreeCatalogList(@RequestParam String oneId, @RequestParam String twoId) { + SysThreeCatalogExample example = new SysThreeCatalogExample(); + example.createCriteria().andOntIdEqualTo(oneId).andTwoIdEqualTo(twoId); + List sysThreeCatalogs = sysThreeCatalogMapper.selectByExample(example); + return new ResultEntity<>(sysThreeCatalogs); }