Commit 4440e97c by ping.wu

缓存时间与产品协商修改

parent e661f0e3
...@@ -133,7 +133,7 @@ public class ShoppingCartBaseServiceImpl implements ShoppingCartBaseService { ...@@ -133,7 +133,7 @@ public class ShoppingCartBaseServiceImpl implements ShoppingCartBaseService {
.filter(k -> StringUtils.isNotEmpty(k.getCartGoodsUid())) .filter(k -> StringUtils.isNotEmpty(k.getCartGoodsUid()))
.collect(Collectors.toMap(CartGoods::getCartGoodsUid, Function.identity(), (k1, k2) -> k1)); .collect(Collectors.toMap(CartGoods::getCartGoodsUid, Function.identity(), (k1, k2) -> k1));
operations.putAll(cartGoodsMap); operations.putAll(cartGoodsMap);
long expire =7; long expire =3;
operations.expire(expire, TimeUnit.DAYS); operations.expire(expire, TimeUnit.DAYS);
return CartResponseUtil.success(); return CartResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -80,7 +80,7 @@ public class ShoppingCartMallBaseServiceImpl implements ShoppingCartBaseService ...@@ -80,7 +80,7 @@ public class ShoppingCartMallBaseServiceImpl implements ShoppingCartBaseService
.filter(k -> StringUtils.isNotEmpty(k.getCartGoodsUid())) .filter(k -> StringUtils.isNotEmpty(k.getCartGoodsUid()))
.collect(Collectors.toMap(CartGoods::getCartGoodsUid, Function.identity(), (k1, k2) -> k1)); .collect(Collectors.toMap(CartGoods::getCartGoodsUid, Function.identity(), (k1, k2) -> k1));
operations.putAll(cartGoodsMap); operations.putAll(cartGoodsMap);
long expire =7; long expire =30;
operations.expire(expire, TimeUnit.DAYS); operations.expire(expire, TimeUnit.DAYS);
return this.getCartGoodsList(cartParamDto, trackingNo); return this.getCartGoodsList(cartParamDto, trackingNo);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -267,22 +267,4 @@ public class ShoppingCartController { ...@@ -267,22 +267,4 @@ public class ShoppingCartController {
return SDKCommonBaseContextWare.getBean(ShoppingCartNewServiceImpl.class).replaceGoodsByShop(request); return SDKCommonBaseContextWare.getBean(ShoppingCartNewServiceImpl.class).replaceGoodsByShop(request);
} }
/**
* 工具代码,后续删除
*/
@Autowired
private RedisTemplate redisTemplate;
@PostMapping(value = "/deleteRedis")
@LogIgnore(excludeStatusCodes = {ResponseCodeConstant.RESPONSE_SUCCESS_STR},logMessage = "/replaceGoodsByShop")
public BaseResponse deleteRedis(@LogParams @RequestBody ShopGoodsReplaceVo request) {
String keys = request.getAppId() != null ? request.getAppId() : "saas:user:info:cart";
Integer number = redisTemplate.keys(keys + "*").size();
if(request.getHook()!= null){
Long delete = redisTemplate.delete(redisTemplate.keys(keys + "*"));
return new BaseResponse("2","100",delete);
}
return new BaseResponse("1","100",number);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment