update 重写 spring-cache 实现 更人性化的操作 支持注解指定ttl等一些参数

This commit is contained in:
疯狂的狮子Li
2022-08-13 11:30:33 +08:00
parent 5d367b7bf8
commit 89c1e4f91d
6 changed files with 230 additions and 76 deletions

View File

@ -0,0 +1,23 @@
package com.ruoyi.common.constant;
/**
* 缓存组名称常量
* <p>
* key 格式为 cacheNames#ttl#maxIdleTime#maxSize
* <p>
* ttl 过期时间 如果设置为0则不过期 默认为0
* maxIdleTime 最大空闲时间 根据LRU算法清理空闲数据 如果设置为0则不检测 默认为0
* maxSize 组最大长度 根据LRU算法清理溢出数据 如果设置为0则无限长 默认为0
* <p>
* 例子: test#60s、test#0#60s、test#0#1m#1000、test#1h#0#500
*
* @author Lion Li
*/
public interface CacheNames {
/**
* 演示案例
*/
String DEMO_CACHE = "demo:cache#60s#10m#20";
}