yujian
2019-07-26 6f3ee199558c79d840137c1a77efe462aca63178
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.yeshi.fanli.service.impl.goods;
 
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
 
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.util.pinduoduo.PinDuoDuoApiUtil;
 
@Service
public class PDDCommonTemplateContentServiceImpl implements PDDCommonTemplateContentService {
 
    @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());
        } 
        return null;
    }
}