update 优化 删除掉有问题的方法(使用RedisUtils)
This commit is contained in:
parent
fc72b67090
commit
74af811a3b
@ -1,19 +1,15 @@
|
|||||||
package org.dromara.common.redis.utils;
|
package org.dromara.common.redis.utils;
|
||||||
|
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.redisson.api.RMap;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.springframework.cache.Cache;
|
import org.springframework.cache.Cache;
|
||||||
import org.springframework.cache.CacheManager;
|
import org.springframework.cache.CacheManager;
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存操作工具类 {@link }
|
* 缓存操作工具类
|
||||||
*
|
*
|
||||||
* @author Michelle.Chung
|
* @author Michelle.Chung
|
||||||
* @date 2022/8/13
|
|
||||||
*/
|
*/
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
@SuppressWarnings(value = {"unchecked"})
|
@SuppressWarnings(value = {"unchecked"})
|
||||||
@ -21,16 +17,6 @@ public class CacheUtils {
|
|||||||
|
|
||||||
private static final CacheManager CACHE_MANAGER = SpringUtils.getBean(CacheManager.class);
|
private static final CacheManager CACHE_MANAGER = SpringUtils.getBean(CacheManager.class);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取缓存组内所有的KEY
|
|
||||||
*
|
|
||||||
* @param cacheNames 缓存组名称
|
|
||||||
*/
|
|
||||||
public static Set<Object> keys(String cacheNames) {
|
|
||||||
RMap<Object, Object> rmap = (RMap<Object, Object>) CACHE_MANAGER.getCache(cacheNames).getNativeCache();
|
|
||||||
return rmap.keySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取缓存值
|
* 获取缓存值
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user