wu
2023-11-30 dc31792dc1b8ad1658e49ba8fce9a1be924e6fbb
springboot-vue3/src/main/java/com/example/springboot/service/CategoryService.java
New file
@@ -0,0 +1,51 @@
package com.example.springboot.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.springboot.entity.Category;
import com.example.springboot.entity.vo.CategoryVo;
import java.util.List;
public interface CategoryService extends IService<Category> {
    /**
     * 分页查询分类
     *
     * @param categoryVO
     * @return
     */
    IPage<Category> selectPage(CategoryVo categoryVO);
    /**
     * 查询子集,返回非嵌套数据结构
     *
     * @param id
     * @param bool 是否包含自己
     * @return
     */
    List<Category> selectList(Long id, Boolean bool);
    /**
     * 查询子集,不包含自己,返回非嵌套数据结构
     *
     * @param id   分类的id
     * @param path 分类的路径
     * @return
     */
    List<Category> selectByPath(Long id, String path);
    /**
     * 查询子集,返回嵌套数据结构
     *
     * @return
     */
    List<Category> selectChilds(Long creator);
    /**
     * 查询子集,不包含自己,返回嵌套数据结构
     *
     * @param id
     * @return
     */
    List<Category> selectChild(Long id);
}