| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.special.S11Service;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | @Cacheable(value = "s11Cache", key = "'getPreSaleGoodsCache'+#page")
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> getPreSaleGoodsCache(int page) {
|
| | | String key = "s11_presale_goods-" + page;
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.S11PresaleGoods, page +"");
|
| | | try {
|
| | | String resultStr = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(resultStr)) {
|
| | |
| | | TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(8452, page, Constant.PAGE_SIZE);
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | try {
|
| | | redisManager.cacheCommonString("s11_presale_goods-" + page,
|
| | | new Gson().toJson(result.getTaoBaoGoodsBriefs()), 60 * 60);// 缓存1小时
|
| | | redisManager.cacheCommonString(key, new Gson().toJson(result.getTaoBaoGoodsBriefs()), 60 * 60);// 缓存1小时
|
| | | } catch (Exception e) {
|
| | | }
|
| | | return result.getTaoBaoGoodsBriefs();
|
| | |
| | | sf.setPage(page);
|
| | | sf.setPageSize(Constant.PAGE_SIZE);
|
| | |
|
| | | String key = "s11_presale_goods-type-" + type + "-" + page;
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.S11PresaleGoodsType, type + "-" + page);
|
| | | try {
|
| | | String resultStr = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(resultStr)) {
|