商品缓存
This commit is contained in:
@@ -389,11 +389,16 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|||||||
@Override
|
@Override
|
||||||
public void clearProductCache(Long... categoryIds) {
|
public void clearProductCache(Long... categoryIds) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
|
//分类缓存
|
||||||
String prefix = ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId + "::";
|
String prefix = ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId + "::";
|
||||||
for (Long categoryId : categoryIds) {
|
for (Long categoryId : categoryIds) {
|
||||||
redisService.del(prefix + categoryId);
|
redisService.del(prefix + categoryId);
|
||||||
}
|
}
|
||||||
redisService.del(ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId);
|
redisService.del(ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId);
|
||||||
|
//用户端分组缓存
|
||||||
|
redisService.del(CacheConstant.USER_CLIENT_GROUPS_PRODUCT + "::" + shopId);
|
||||||
|
//用户端热销缓存
|
||||||
|
redisService.del(CacheConstant.USER_CLIENT_HOTS_PRODUCT + "::" + shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user