| | |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse categoryList(ApiProductCategoryPageDto dto) { |
| | | // 创建分页对象,传入当前页和每页大小 |
| | | Page<ApiProductCategoryVo> page = new Page<>(dto.getPageNow(), dto.getPageSize()); |
| | | Page<ApiProductCategoryVo> pageListByQuery = this.getPageListByQuery(page, dto); |
| | | return new FebsResponse().success().data(pageListByQuery); |
| | | public FebsResponse categoryChildList(ApiProductCategoryPageDto dto) { |
| | | List<ApiProductCategoryVo> vos = new ArrayList<>(); |
| | | |
| | | List<AiProductCategory> aiProductCategories = aiProductCategoryMapper.selectList( |
| | | Wrappers.lambdaQuery(AiProductCategory.class) |
| | | .eq(AiProductCategory::getParentId, dto.getParentId()) |
| | | .eq(AiProductCategory::getState, 1) |
| | | .orderByAsc(AiProductCategory::getSort) |
| | | ); |
| | | if (CollUtil.isNotEmpty(aiProductCategories)){ |
| | | for (AiProductCategory aiProductCategory : aiProductCategories) { |
| | | ApiProductCategoryVo vo = new ApiProductCategoryVo(); |
| | | vo.setId(aiProductCategory.getId()); |
| | | vo.setName(aiProductCategory.getName()); |
| | | vos.add(vo); |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(vos); |
| | | } |
| | | |
| | | @Override |