luo
2023-12-25 23c4967b4cb8dbce8277f830f7152d315c5a4a57
guns-admin/src/main/java/com/stylefeng/guns/modular/api/EncyclopedicKnowledgeController.java
@@ -15,6 +15,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
@@ -37,7 +38,13 @@
    @ApiOperation(value = "获取类别", tags = {"知识百科"})
    public ResultUtil<List<SysDataType>> getEncyclopedicKnowledgeType(){
        List<SysDataType> sysDataType = sysDataTypeService.getSysDataType(1);
        return ResultUtil.success(sysDataType);
        List<SysDataType> res = new ArrayList<>();
        // 如果当前类别下 没有内容就不展示了
        for (SysDataType dataType : sysDataType) {
            List<EncyclopedicKnowledgeRes> list = encyclopedicKnowledgeService.getEncyclopedicKnowledgeList(dataType.getId());
            if (list.size()!=0) res.add(dataType);
        }
        return ResultUtil.success(res);
    }