| | |
| | | ApiClothesCategoryInfoVo apiClothesCategoryInfoVo = new ApiClothesCategoryInfoVo(); |
| | | apiClothesCategoryInfoVo.setId(0L); |
| | | apiClothesCategoryInfoVo.setName("全部"); |
| | | apiClothesCategoryInfoVo.setType(2); |
| | | vos.add(apiClothesCategoryInfoVo); |
| | | List<ClothesSocialCategory> list = clothesSocialCategoryMapper.selectList( |
| | | Wrappers.lambdaQuery(ClothesSocialCategory.class) |
| | |
| | | .orderByAsc(ClothesSocialCategory::getOrderCnt) |
| | | ); |
| | | if(CollUtil.isNotEmpty(list)){ |
| | | vos = buildApiClothesCategoryInfoVo(list, vos); |
| | | vos = buildApiClothesCategoryInfoVo(list, vos,2); |
| | | } |
| | | |
| | | return new FebsResponse().success().data(vos); |
| | | } |
| | | |
| | | private List<ApiClothesCategoryInfoVo> buildApiClothesCategoryInfoVo(List<ClothesSocialCategory> list, List<ApiClothesCategoryInfoVo> vos) { |
| | | private List<ApiClothesCategoryInfoVo> buildApiClothesCategoryInfoVo(List<ClothesSocialCategory> list, List<ApiClothesCategoryInfoVo> vos,Integer type) { |
| | | for (ClothesSocialCategory entity : list) { |
| | | ApiClothesCategoryInfoVo vo = new ApiClothesCategoryInfoVo(); |
| | | vo.setId(entity.getId()); |
| | | vo.setName(entity.getName()); |
| | | vo.setType(1); |
| | | vo.setType(type); |
| | | vos.add(vo); |
| | | } |
| | | return vos; |
| | |
| | | .orderByAsc(ClothesSocialCategory::getOrderCnt) |
| | | ); |
| | | if(CollUtil.isNotEmpty(list)){ |
| | | vos = buildApiClothesCategoryInfoVo(list, vos); |
| | | vos = buildApiClothesCategoryInfoVo(list, vos,1); |
| | | } |
| | | return new FebsResponse().success().data(vos); |
| | | } |