Administrator
2025-07-18 f7de67c92de1bd55154c5a2f879e99a1b476750b
refactor(mall): 调整衣服分类逻辑

- 将"全部"分类调整到列表开头
- 优化代码结构,提高可读性
1 files modified
8 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java
@@ -66,6 +66,10 @@
    @Override
    public FebsResponse allCategory() {
        List<ApiClothesCategoryInfoVo> vos = new ArrayList<>();
        ApiClothesCategoryInfoVo apiClothesCategoryInfoVo = new ApiClothesCategoryInfoVo();
        apiClothesCategoryInfoVo.setId(0L);
        apiClothesCategoryInfoVo.setName("全部");
        vos.add(apiClothesCategoryInfoVo);
        List<ClothesSocialCategory> list = clothesSocialCategoryMapper.selectList(
                Wrappers.lambdaQuery(ClothesSocialCategory.class)
                        .select(ClothesSocialCategory::getId, ClothesSocialCategory::getName)
@@ -76,10 +80,6 @@
        if(CollUtil.isNotEmpty(list)){
            vos = buildApiClothesCategoryInfoVo(list, vos);
        }
        ApiClothesCategoryInfoVo apiClothesCategoryInfoVo = new ApiClothesCategoryInfoVo();
        apiClothesCategoryInfoVo.setId(0L);
        apiClothesCategoryInfoVo.setName("全部");
        vos.add(apiClothesCategoryInfoVo);
        return new FebsResponse().success().data(vos);
    }