|
|
@ -10,10 +10,9 @@ import org.springframework.cache.CacheManager;
|
|
|
|
import java.util.Set;
|
|
|
|
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 +20,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();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取缓存值
|
|
|
|
* 获取缓存值
|
|
|
|
*
|
|
|
|
*
|
|
|
|