mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-10 02:57:17 +08:00
refactor: 适配 ContiNew Starter Spring Cache(缓存模块)
This commit is contained in:
@@ -16,28 +16,25 @@
|
||||
|
||||
package top.charles7c.continew.admin;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
|
||||
import org.dromara.x.file.storage.spring.EnableFileStorage;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.URLUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
|
||||
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
@@ -45,6 +42,7 @@ import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperti
|
||||
* @since 2022/12/8 23:15
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableCaching
|
||||
@EnableFileStorage
|
||||
@RestController
|
||||
@SpringBootApplication
|
||||
|
||||
@@ -55,33 +55,31 @@ spring.liquibase:
|
||||
# 配置文件路径
|
||||
change-log: classpath:/db/changelog/db.changelog-master.yaml
|
||||
|
||||
--- ### Redis 配置(单机版)
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启 SSL
|
||||
ssl:
|
||||
enabled: false
|
||||
redisson:
|
||||
enabled: true
|
||||
mode: SINGLE
|
||||
|
||||
--- ### Spring Cache 配置
|
||||
spring.cache:
|
||||
redis:
|
||||
# 缓存过期时长(单位:毫秒,默认 -1,表示永不过期)
|
||||
time-to-live: 7200000
|
||||
# 是否允许缓存空值(默认 true,表示允许,可以解决缓存穿透问题)
|
||||
cache-null-values: true
|
||||
--- ### 缓存配置
|
||||
spring:
|
||||
## Spring Cache 配置
|
||||
cache:
|
||||
type: REDIS
|
||||
data:
|
||||
## Redis 配置(单机版)
|
||||
redis:
|
||||
# 地址
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启 SSL
|
||||
ssl:
|
||||
enabled: false
|
||||
# Redisson 配置
|
||||
redisson:
|
||||
enabled: true
|
||||
mode: SINGLE
|
||||
|
||||
--- ### 验证码配置
|
||||
continew-starter.captcha:
|
||||
|
||||
@@ -57,33 +57,31 @@ spring.liquibase:
|
||||
# 配置文件路径
|
||||
change-log: classpath:/db/changelog/db.changelog-master.yaml
|
||||
|
||||
--- ### Redis 配置(单机版)
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启 SSL
|
||||
ssl:
|
||||
enabled: false
|
||||
redisson:
|
||||
enabled: true
|
||||
mode: SINGLE
|
||||
|
||||
--- ### Spring Cache 配置
|
||||
spring.cache:
|
||||
redis:
|
||||
# 缓存过期时长(单位:毫秒,默认 -1,表示永不过期)
|
||||
time-to-live: 7200000
|
||||
# 是否允许缓存空值(默认 true,表示允许,可以解决缓存穿透问题)
|
||||
cache-null-values: true
|
||||
--- ### 缓存配置
|
||||
spring:
|
||||
## Spring Cache 配置
|
||||
cache:
|
||||
type: REDIS
|
||||
data:
|
||||
## Redis 配置(单机版)
|
||||
redis:
|
||||
# 地址
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启 SSL
|
||||
ssl:
|
||||
enabled: false
|
||||
# Redisson 配置
|
||||
redisson:
|
||||
enabled: true
|
||||
mode: SINGLE
|
||||
|
||||
--- ### 验证码配置
|
||||
continew-starter.captcha:
|
||||
|
||||
Reference in New Issue
Block a user