| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @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); |
| | | } |
| | | |
| | | |