| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | |
| | | return;
|
| | | }
|
| | | // 保存20分钟
|
| | | String key = "PDD-goods-" + goods.getGoodsId();
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.PDDGoods, goods.getGoodsId() + "" );
|
| | | redisManager.cacheCommonString(key, new Gson().toJson(goods), 60 * 20);
|
| | | }
|
| | |
|
| | |
| | | * @return
|
| | | */
|
| | | public PDDGoodsDetail getGoodsInfo(long goodsId){
|
| | | String key = "PDD-goods-" + goodsId;
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.PDDGoods, goodsId + "");
|
| | | String value = redisManager.getCommonString(key);
|
| | | if (!StringUtil.isNullOrEmpty(value)) {
|
| | | return JsonUtil.getSimpleGson().fromJson(value, PDDGoodsDetail.class);
|