使用Java8 的stream编程分组、排序组装vo;
减少数据库的多表关系查询情况(超过3张表的关联查询直接忽略,)
文档:
https://essp-test.lhhspay.com.cn/MAS-OPENAPI-SERVICE/swagger-ui.html?urls.primaryName=v2#/%E9%97%A8%E5%BA%97%E5%B9%B3%E5%8F%B0%E7%B1%BB%E7%9B%AE%E5%95%86%E5%93%81
package com.miniso.pintea.core.service.impl;
import com.google.common.collect.Lists;
import com.miniso.pintea.common.constant.redis.CoreRedisConstant;
import com.miniso.pintea.core.dao.PlatformCategoryDao;
import com.miniso.pintea.core.dao.SkuDao;
import com.miniso.pintea.core.dto.CategoryDTO;
import com.miniso.pintea.core.dto.SpuAndSkuDto;
import com.miniso.pintea.core.mapper.SpuMapper;
import com.miniso.pintea.core.service.PlatformCategoryService;
import com.miniso.pintea.core.util.RedisUtil;
import com.miniso.pintea.core.vo.response.CategoryAndGoods;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author chengwenzhi
* @Description: 平台类目接口实现
* @Date: Created in 15:01 2020/8/15
*/
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor