package com.yeshi.fanli.service.impl.pdd;
|
|
import java.util.List;
|
|
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.stereotype.Service;
|
|
import com.yeshi.fanli.service.inter.pdd.PDDGoodsService;
|
import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
|
@Service
|
public class PDDGoodsServiceImpl implements PDDGoodsService {
|
|
@Cacheable(value = "pddCache", key = "'getDetailImageList'+#id")
|
@Override
|
public List<String> getDetailImageList(Long id) {
|
List<String> list = null;
|
int count = 0;
|
// 重试3次
|
while ((list == null || list.size() == 0) && count < 3) {
|
list = PinDuoDuoUtil.getDetailImages(id);
|
count++;
|
}
|
return list;
|
}
|
|
}
|