diff --git a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/H5ComponentCategoryService.java b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/H5ComponentCategoryService.java index 47aefb07f..71426298c 100644 --- a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/H5ComponentCategoryService.java +++ b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/H5ComponentCategoryService.java @@ -15,20 +15,20 @@ import java.util.List; */ public interface H5ComponentCategoryService { - /** - * 查询所有一级分类 - * - * @return 一级分类列表 - */ - List getTopLevelCategories(); - - /** - * 根据父分类 ID 查询子分类 - * - * @param parentId 父分类 ID - * @return 子分类列表 - */ - List getChildCategories(Long parentId); +// /** +// * 查询所有一级分类 +// * +// * @return 一级分类列表 +// */ +// List getTopLevelCategories(); +// +// /** +// * 根据父分类 ID 查询子分类 +// * +// * @param parentId 父分类 ID +// * @return 子分类列表 +// */ +// List getChildCategories(Long parentId); /** * 根据类型查询分类 diff --git a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/impl/H5ComponentCategoryServiceImpl.java b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/impl/H5ComponentCategoryServiceImpl.java index 5b0cc840a..b113faa23 100644 --- a/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/impl/H5ComponentCategoryServiceImpl.java +++ b/ruoyi-site/ruoyi-h5/src/main/java/com/luban/api/service/impl/H5ComponentCategoryServiceImpl.java @@ -30,25 +30,23 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class H5ComponentCategoryServiceImpl extends ServiceImpl implements H5ComponentCategoryService { - private final H5ComponentCategoryDao h5ComponentCategoryDao; +// @Override +// public List getTopLevelCategories() { +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.eq(H5ComponentCategory::getParentId, 0L) +// .orderByAsc(H5ComponentCategory::getSort); +// +// return baseMapper.selectList(wrapper); +// } - @Override - public List getTopLevelCategories() { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(H5ComponentCategory::getParentId, 0L) - .orderByAsc(H5ComponentCategory::getSort); - - return baseMapper.selectList(wrapper); - } - - @Override - public List getChildCategories(Long parentId) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(H5ComponentCategory::getParentId, parentId) - .orderByAsc(H5ComponentCategory::getSort); - - return baseMapper.selectList(wrapper); - } +// @Override +// public List getChildCategories(Long parentId) { +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.eq(H5ComponentCategory::getParentId, parentId) +// .orderByAsc(H5ComponentCategory::getSort); +// +// return baseMapper.selectList(wrapper); +// } @Override public List getCategoriesByType(String type) { @@ -100,7 +98,7 @@ public class H5ComponentCategoryServiceImpl extends ServiceImpl getCategoryTree() { // 一次性查询所有分类(排除已删除的) LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.orderByAsc(H5ComponentCategory::getParentId, H5ComponentCategory::getSort); + wrapper.orderByAsc(H5ComponentCategory::getId, H5ComponentCategory::getSort); List allCategories = baseMapper.selectList(wrapper); @@ -176,7 +174,7 @@ public class H5ComponentCategoryServiceImpl extends ServiceImpl(queryDTO.getPageNum(), queryDTO.getPageSize()), wrapper); }