| | |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse hotV2(ApiProductCategoryHotDto dto) { |
| | | |
| | | List<ApiProductCategoryVo> list = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<AiProductCategory> query = Wrappers.lambdaQuery(AiProductCategory.class); |
| | | if (StrUtil.isNotEmpty(dto.getCompanyId())){ |
| | | query.eq(AiProductCategory::getCompanyId, dto.getCompanyId()); |
| | | }else{ |
| | | query.isNull(AiProductCategory::getCompanyId); |
| | | } |
| | | query.eq(AiProductCategory::getLevel, ProductCategoryLevelEnum.LEVEL_ONE.getLevel()); |
| | | query.eq(AiProductCategory::getState, 1); |
| | | query.eq(AiProductCategory::getHotState, 1); |
| | | query.orderByAsc(AiProductCategory::getSort); |
| | | List<AiProductCategory> listByQuery = this.getListByQuery(query); |
| | | if (CollUtil.isNotEmpty(listByQuery)){ |
| | | for (AiProductCategory aiProductCategory : listByQuery){ |
| | | ApiProductCategoryVo apiProductCategoryVo = new ApiProductCategoryVo(); |
| | | apiProductCategoryVo.setId(aiProductCategory.getId()); |
| | | apiProductCategoryVo.setName(aiProductCategory.getName()); |
| | | apiProductCategoryVo.setBackImg(aiProductCategory.getBackImg()); |
| | | apiProductCategoryVo.setIconImg(aiProductCategory.getIconImg()); |
| | | list.add(apiProductCategoryVo); |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(list); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse categoryList(ApiProductCategoryPageDto dto) { |
| | | // 创建分页对象,传入当前页和每页大小 |
| | | Page<ApiProductCategoryVo> page = new Page<>(dto.getPageNow(), dto.getPageSize()); |