package com.yeshi.fanli.service.impl.goods;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.stereotype.Service;
|
|
import com.yeshi.fanli.dto.common.CommonContentNav;
|
import com.yeshi.fanli.dto.common.PDDCommonContentTypeEnum;
|
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
import com.yeshi.fanli.service.inter.goods.PDDCommonTemplateContentService;
|
import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
|
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
|
@Service
|
public class PDDCommonTemplateContentServiceImpl implements PDDCommonTemplateContentService {
|
|
@Resource
|
private PDDGoodsService pddGoodsService;
|
|
|
@Cacheable(value = "pddCommonContentCache", key = "#type+'-'+#cid+'-'+#page+'-'+#pageSize")
|
@Override
|
public PDDGoodsResult getContentList(PDDCommonContentTypeEnum type, String cid, int page, int pageSize) {
|
if (type == PDDCommonContentTypeEnum._1k9 || type == PDDCommonContentTypeEnum.todayTop
|
|| type == PDDCommonContentTypeEnum.brandClear) {
|
return PinDuoDuoApiUtil.searchByChannelType(page - 1, pageSize, type.getContent());
|
} else if (type == PDDCommonContentTypeEnum.hotSaleGoods) {
|
return pddGoodsService.getTopGoodsList(page, 2);
|
}
|
return null;
|
}
|
|
|
@Override
|
public List<CommonContentNav> getNavList(PDDCommonContentTypeEnum type) {
|
List<CommonContentNav> navList = new ArrayList<>();
|
if (type == PDDCommonContentTypeEnum.hotSaleGoods) {
|
|
}
|
return navList;
|
}
|
}
|