feat: 升级springboot3

This commit is contained in:
2025-10-30 16:25:30 +08:00
parent 7321a9e172
commit 2a72c5f783
68 changed files with 242 additions and 436 deletions
@@ -46,6 +46,12 @@ spring:
type: redis
data:
redis:
database: ${REDIS_DB:1}
host: ${REDIS_HOST:192.168.100.128}
port: ${REDIS_PORT:26379}
password: ${REDIS_PWD:kd123456}
# 连接超时时间
timeout: 5000
repositories:
# 是否启用Redis存储(关闭防止出现 Multiple Spring Data modules found, entering strict repository configuration mode)
enabled: false
@@ -109,24 +115,6 @@ spring:
config:
multi-statement-allow: true
aop-patterns: "cn.odboy.mapper.*,cn.odboy.service.*,cn.odboy.*.mapper.*,cn.odboy.*.service.*"
redis:
database: ${REDIS_DB:1}
host: ${REDIS_HOST:192.168.100.128}
port: ${REDIS_PORT:26379}
password: ${REDIS_PWD:kd123456}
# 连接超时时间
timeout: 5000
# 连接池配置
lettuce:
pool:
# 连接池最大连接数
max-active: 30
# 连接池最大阻塞等待时间(毫秒),负值表示没有限制
max-wait: -1
# 连接池中的最大空闲连接数
max-idle: 20
# 连接池中的最小空闲连接数
min-idle: 1
# 数据库一定不能区分大小写
quartz:
# 必需,指定使用 JDBC 存储
@@ -46,6 +46,23 @@ spring:
type: redis
data:
redis:
database: ${REDIS_DB:1}
host: ${REDIS_HOST:192.168.100.128}
port: ${REDIS_PORT:26379}
password: ${REDIS_PWD:kd123456}
# 连接超时时间
timeout: 5000
# 连接池配置
lettuce:
pool:
# 连接池最大连接数
max-active: 30
# 连接池最大阻塞等待时间(毫秒),负值表示没有限制
max-wait: -1
# 连接池中的最大空闲连接数
max-idle: 20
# 连接池中的最小空闲连接数
min-idle: 1
repositories:
# 是否启用Redis存储(关闭防止出现 Multiple Spring Data modules found, entering strict repository configuration mode)
enabled: false
@@ -53,10 +70,10 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
# sql监控
# driverClassName: com.p6spy.engine.spy.P6SpyDriver
# url: jdbc:p6spy:mysql://192.168.100.128:23306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.100.128:23306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://192.168.100.128:23306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://192.168.100.128:23306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: kd123456
# 初始连接数,建议设置为与最小空闲连接数相同
@@ -109,24 +126,6 @@ spring:
config:
multi-statement-allow: true
aop-patterns: "cn.odboy.mapper.*,cn.odboy.service.*,cn.odboy.*.mapper.*,cn.odboy.*.service.*"
redis:
database: ${REDIS_DB:1}
host: ${REDIS_HOST:192.168.100.128}
port: ${REDIS_PORT:26379}
password: ${REDIS_PWD:kd123456}
# 连接超时时间
timeout: 5000
# 连接池配置
lettuce:
pool:
# 连接池最大连接数
max-active: 30
# 连接池最大阻塞等待时间(毫秒),负值表示没有限制
max-wait: -1
# 连接池中的最大空闲连接数
max-idle: 20
# 连接池中的最小空闲连接数
min-idle: 1
# 数据库一定不能区分大小写
quartz:
# 必需,指定使用 JDBC 存储
@@ -136,7 +135,7 @@ spring:
quartz:
scheduler:
# 必需,指定调度器实例的名称
instanceName: cutejava
instanceName: ${spring.application.name}
# 必需,指定调度器实例的 ID
instanceId: auto
threadPool:
@@ -193,8 +192,8 @@ app:
private-key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
# 鉴权
jwt:
# 必须使用最少88位的Base64对该令牌进行编码
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
# 必须使用最少88位的Base64对该令牌进行编码 cn.odboy.util.CsBase64SecretUtil
base64-secret: YzE5ZWNjMjlkMGY4NDc4MDlmYzE0Y2I0MTk4YTQ4YjY5NTU0OGQxODNjNjQ0MmU1YjBmZTYwYjljYzI0M2M4MTJkZjk3Y2ZlYjg3ZTQxMjM4MjEwY2ZiYzE4YmFiYmZlZDVhM2M1YmI3M2FmNDFmNWJmM2MyMTM1ZDNhMmRmYzY=
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 14400000
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
@@ -204,7 +203,7 @@ app:
# 登录
login:
# 是否限制单用户登录
single: false
single: true
# 验证码
captchaSetting:
# 验证码类型配置 查看 LoginProperties 类
@@ -223,7 +222,7 @@ app:
font-size: 25
# 是否开启 swagger-ui
swagger:
enabled: true
enabled: false
# 针对@Async
async-task-pool:
# 核心线程池大小
@@ -23,6 +23,7 @@ import org.springframework.mock.web.MockHttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;
import static cn.odboy.util.CsStringUtil.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
@@ -30,27 +31,27 @@ public class CsStringUtilTest {
@Test
public void testToCamelCase() {
assertNull(CsStringUtil.toCamelCase(null));
assertNull(toCamelCase(null));
}
@Test
public void testToCapitalizeCamelCase() {
assertNull(CsStringUtil.toCapitalizeCamelCase(null));
assertEquals("HelloWorld", CsStringUtil.toCapitalizeCamelCase("hello_world"));
assertEquals("HelloWorld", toCapitalizeCamelCase("hello_world"));
}
@Test
public void testToUnderScoreCase() {
assertNull(CsStringUtil.toUnderScoreCase(null));
assertEquals("hello_world", CsStringUtil.toUnderScoreCase("helloWorld"));
assertEquals("\u0000\u0000", CsStringUtil.toUnderScoreCase("\u0000\u0000"));
assertEquals("\u0000_a", CsStringUtil.toUnderScoreCase("\u0000A"));
assertEquals("hello_world", toUnderScoreCase("helloWorld"));
assertEquals("\u0000\u0000", toUnderScoreCase("\u0000\u0000"));
assertEquals("\u0000_a", toUnderScoreCase("\u0000A"));
}
@Test
public void testGetWeekDay() {
SimpleDateFormat simpleDateformat = new SimpleDateFormat("E");
assertEquals(simpleDateformat.format(new Date()), CsStringUtil.getWeekDay());
assertEquals(simpleDateformat.format(new Date()), getWeekDay());
}
@Test