feat(db): 迁移数据库迁移脚本 V1-V5(任务 T1.1) #4
-36
@@ -1,36 +0,0 @@
|
|||||||
package cn.novalon.manage.common.config;
|
|
||||||
|
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
|
||||||
import org.springframework.cache.CacheManager;
|
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
|
||||||
import org.springframework.cache.caffeine.CaffeineCacheManager;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缓存配置类
|
|
||||||
*
|
|
||||||
* @author 张翔
|
|
||||||
* @date 2026-03-13
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@EnableCaching
|
|
||||||
public class CacheConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public CacheManager cacheManager() {
|
|
||||||
CaffeineCacheManager cacheManager = new CaffeineCacheManager();
|
|
||||||
cacheManager.setCaffeine(caffeineCacheBuilder());
|
|
||||||
return cacheManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Caffeine<Object, Object> caffeineCacheBuilder() {
|
|
||||||
return Caffeine.newBuilder()
|
|
||||||
.initialCapacity(100)
|
|
||||||
.maximumSize(500)
|
|
||||||
.expireAfterWrite(30, TimeUnit.MINUTES)
|
|
||||||
.recordStats();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-1
@@ -1,2 +1 @@
|
|||||||
cn.novalon.manage.common.config.CacheConfig
|
|
||||||
cn.novalon.manage.common.config.JwtProperties
|
cn.novalon.manage.common.config.JwtProperties
|
||||||
Reference in New Issue
Block a user