提交 87c23970 作者: 方治民

chore: update deps(springboot v3.2.0 ...)

上级 f4e24024
...@@ -65,5 +65,5 @@ dependencies { ...@@ -65,5 +65,5 @@ dependencies {
implementation "cn.hutool:hutool-extra:${hutoolVersion}" implementation "cn.hutool:hutool-extra:${hutoolVersion}"
// https://github.com/vladmihalcea/hypersistence-utils // https://github.com/vladmihalcea/hypersistence-utils
implementation "io.hypersistence:hypersistence-utils-hibernate-60:${hibernateTypesVersion}" implementation "io.hypersistence:hypersistence-utils-hibernate-63:${hibernateTypesVersion}"
} }
...@@ -28,6 +28,8 @@ import net.bramp.ffmpeg.FFprobe; ...@@ -28,6 +28,8 @@ import net.bramp.ffmpeg.FFprobe;
import net.bramp.ffmpeg.builder.FFmpegBuilder; import net.bramp.ffmpeg.builder.FFmpegBuilder;
import net.bramp.ffmpeg.probe.FFmpegFormat; import net.bramp.ffmpeg.probe.FFmpegFormat;
import net.bramp.ffmpeg.probe.FFmpegProbeResult; import net.bramp.ffmpeg.probe.FFmpegProbeResult;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer; import org.apache.pdfbox.rendering.PDFRenderer;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
...@@ -86,7 +88,7 @@ public class UploadProcessServiceImpl implements UploadProcessService { ...@@ -86,7 +88,7 @@ public class UploadProcessServiceImpl implements UploadProcessService {
@Cleanup @Cleanup
InputStream is = file.getInputStream(); InputStream is = file.getInputStream();
@Cleanup @Cleanup
PDDocument doc = PDDocument.load(is); PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(is));
int pages = doc.getNumberOfPages(); int pages = doc.getNumberOfPages();
// 构建具有 PDF 页数标记的存储地址 // 构建具有 PDF 页数标记的存储地址
......
...@@ -15,7 +15,6 @@ spring: ...@@ -15,7 +15,6 @@ spring:
username: ${env.props.username} username: ${env.props.username}
password: ${env.props.password} password: ${env.props.password}
jpa: jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
open-in-view: true open-in-view: true
hibernate: hibernate:
ddl-auto: update ddl-auto: update
......
...@@ -13,13 +13,9 @@ dependencies { ...@@ -13,13 +13,9 @@ dependencies {
implementation "com.github.xiaoymin:knife4j-openapi3-jakarta-spring-boot-starter:${knife4jOpen3Version}" implementation "com.github.xiaoymin:knife4j-openapi3-jakarta-spring-boot-starter:${knife4jOpen3Version}"
// sa-token // sa-token
api("cn.dev33:sa-token-spring-boot3-starter:${saTokenVersion}") { api "cn.dev33:sa-token-spring-boot3-starter:${saTokenVersion}"
// FIX: 1.33 CVE
exclude group: 'org.yaml', module: 'snakeyaml'
}
implementation "org.yaml:snakeyaml:${snakeyamlVersion}"
// Sa-Token 整合 Redis (使用 jackson 序列化方式) // Sa-Token 整合 Redis (使用 jackson 序列化方式)
implementation "cn.dev33:sa-token-dao-redis-jackson:${saTokenVersion}" implementation "cn.dev33:sa-token-redis-jackson:${saTokenVersion}"
implementation 'org.apache.commons:commons-pool2' implementation 'org.apache.commons:commons-pool2'
// fastjson // fastjson
...@@ -29,8 +25,8 @@ dependencies { ...@@ -29,8 +25,8 @@ dependencies {
implementation "cn.hutool:hutool-core:${hutoolVersion}" implementation "cn.hutool:hutool-core:${hutoolVersion}"
// https://github.com/vladmihalcea/hypersistence-utils // https://github.com/vladmihalcea/hypersistence-utils
// hypersistence-utils-hibernate-60 // hypersistence-utils-hibernate-63
implementation "io.hypersistence:hypersistence-utils-hibernate-60:${hibernateTypesVersion}" implementation "io.hypersistence:hypersistence-utils-hibernate-63:${hibernateTypesVersion}"
// https://mvnrepository.com/artifact/org.jetbrains/annotations // https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation "org.jetbrains:annotations:${jetbrainsAnnotationsVersion}" implementation "org.jetbrains:annotations:${jetbrainsAnnotationsVersion}"
......
/* (C) 2023 YiRing, Inc. */
package com.yiring.auth.config;
import cn.dev33.satoken.spring.SaTokenContextForSpringInJakartaServlet;
import cn.dev33.satoken.spring.pathmatch.SaPatternsRequestConditionHolder;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
/**
* 自定义 SaTokenContext 实现类,重写 matchPath 方法,切换为 ant_path_matcher 模式,使之可以支持 `**` 之后再出现内容
* @author Jim
* @version 0.1
* 2023/12/19 11:57
*/
@Primary
@Component
public class SaTokenContextByPatternsRequestCondition extends SaTokenContextForSpringInJakartaServlet {
@Override
public boolean matchPath(String pattern, String path) {
return SaPatternsRequestConditionHolder.match(pattern, path);
}
}
...@@ -49,7 +49,7 @@ public class Auths { ...@@ -49,7 +49,7 @@ public class Auths {
Object id = StpUtil.getLoginIdByToken(token); Object id = StpUtil.getLoginIdByToken(token);
if (id == null) { if (id == null) {
StpUtil.logoutByTokenValue(token); StpUtil.logoutByTokenValue(token);
throw NotLoginException.newInstance(StpUtil.TYPE, null); throw NotLoginException.newInstance(StpUtil.TYPE, null, "Token 无效", token);
} }
Optional<User> optional = userRepository.findById(Objects.toString(id)); Optional<User> optional = userRepository.findById(Objects.toString(id));
...@@ -59,7 +59,7 @@ public class Auths { ...@@ -59,7 +59,7 @@ public class Auths {
Boolean.TRUE.equals(optional.get().getDisabled()) Boolean.TRUE.equals(optional.get().getDisabled())
) { ) {
StpUtil.logout(id); StpUtil.logout(id);
throw NotLoginException.newInstance(StpUtil.TYPE, NotLoginException.INVALID_TOKEN); throw NotLoginException.newInstance(StpUtil.TYPE, NotLoginException.INVALID_TOKEN, "用户被禁用", token);
} }
return optional.get(); return optional.get();
...@@ -72,7 +72,7 @@ public class Auths { ...@@ -72,7 +72,7 @@ public class Auths {
public User getLoginUser() { public User getLoginUser() {
String token = StpUtil.getTokenValue(); String token = StpUtil.getTokenValue();
if (token == null) { if (token == null) {
throw NotLoginException.newInstance(StpUtil.TYPE, null); throw NotLoginException.newInstance(StpUtil.TYPE, null, "用户未登录", null);
} }
return getUserByToken(token); return getUserByToken(token);
......
...@@ -5,7 +5,7 @@ sa-token: ...@@ -5,7 +5,7 @@ sa-token:
# token有效期,单位s 默认30天, -1代表永不过期 # token有效期,单位s 默认30天, -1代表永不过期
timeout: 2592000 timeout: 2592000
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 # token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
activity-timeout: -1 active-timeout: -1
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
is-concurrent: true is-concurrent: true
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
......
...@@ -20,8 +20,8 @@ dependencies { ...@@ -20,8 +20,8 @@ dependencies {
implementation "org.locationtech.jts:jts-core:${jtsVersion}" implementation "org.locationtech.jts:jts-core:${jtsVersion}"
// https://github.com/vladmihalcea/hypersistence-utils // https://github.com/vladmihalcea/hypersistence-utils
// hypersistence-utils-hibernate-60 // hypersistence-utils-hibernate-63
implementation "io.hypersistence:hypersistence-utils-hibernate-60:${hibernateTypesVersion}" implementation "io.hypersistence:hypersistence-utils-hibernate-63:${hibernateTypesVersion}"
// https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts/1.2.10 // https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts/1.2.10
implementation("org.n52.jackson:jackson-datatype-jts:1.2.10") { implementation("org.n52.jackson:jackson-datatype-jts:1.2.10") {
......
...@@ -13,11 +13,7 @@ dependencies { ...@@ -13,11 +13,7 @@ dependencies {
implementation "com.github.xiaoymin:knife4j-openapi3-jakarta-spring-boot-starter:${knife4jOpen3Version}" implementation "com.github.xiaoymin:knife4j-openapi3-jakarta-spring-boot-starter:${knife4jOpen3Version}"
// minio // minio
api("io.minio:minio:${minioVersion}") { api "io.minio:minio:${minioVersion}"
// FIX: 1.33 CVE
exclude group: 'org.yaml', module: 'snakeyaml'
}
implementation "org.yaml:snakeyaml:${snakeyamlVersion}"
// hutool // hutool
implementation "cn.hutool:hutool-core:${hutoolVersion}" implementation "cn.hutool:hutool-core:${hutoolVersion}"
......
...@@ -2,12 +2,12 @@ plugins { ...@@ -2,12 +2,12 @@ plugins {
id 'java' id 'java'
id 'java-library' id 'java-library'
// https://start.spring.io // https://start.spring.io
id 'org.springframework.boot' version '3.1.1' id 'org.springframework.boot' version '3.2.0'
id 'org.graalvm.buildtools.native' version '0.9.23' id 'org.graalvm.buildtools.native' version '0.9.28'
// https://plugins.gradle.org/plugin/io.spring.dependency-management // https://plugins.gradle.org/plugin/io.spring.dependency-management
id 'io.spring.dependency-management' version '1.1.0' id 'io.spring.dependency-management' version '1.1.4'
// https://plugins.gradle.org/plugin/com.diffplug.spotless // https://plugins.gradle.org/plugin/com.diffplug.spotless
id "com.diffplug.spotless" version "6.19.0" id "com.diffplug.spotless" version "6.23.3"
} }
ext { ext {
...@@ -23,45 +23,46 @@ ext { ...@@ -23,45 +23,46 @@ ext {
// SpringCloud // SpringCloud
// https://start.spring.io/ // https://start.spring.io/
springCloudVersion = '2022.0.3' springCloudVersion = '2023.0.0'
// springBootAdminVersion // springBootAdminVersion
// https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server // https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server
springBootAdminVersion = '3.1.0' // FIXED: 版本号不兼容,暂时去掉
// springBootAdminVersion = '3.1.0'
// Dependencies // Dependencies
// https://central.sonatype.com/artifact/com.github.xiaoymin/knife4j-openapi3-jakarta-spring-boot-starter // https://central.sonatype.com/artifact/com.github.xiaoymin/knife4j-openapi3-jakarta-spring-boot-starter
knife4jOpen3Version = '4.1.0' knife4jOpen3Version = '4.4.0'
// https://central.sonatype.com/artifact/io.swagger.core.v3/swagger-annotations // https://central.sonatype.com/artifact/io.swagger.core.v3/swagger-annotations
swaggerAnnotationsVersion = '2.2.14' swaggerAnnotationsVersion = '2.2.19'
// https://central.sonatype.com/artifact/cn.dev33/sa-token-spring-boot3-starter // https://central.sonatype.com/artifact/cn.dev33/sa-token-spring-boot3-starter
saTokenVersion = '1.34.0' saTokenVersion = '1.37.0'
// https://central.sonatype.com/artifact/cn.hutool/hutool-core // https://central.sonatype.com/artifact/cn.hutool/hutool-core
hutoolVersion = '5.8.20' hutoolVersion = '5.8.23'
// https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2 // https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2
fastJsonVersion = '2.0.34' fastJsonVersion = '2.0.43'
// https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core // https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '2.4.0' xxlJobVersion = '2.4.0'
// https://central.sonatype.com/artifact/com.squareup.okhttp3/okhttp // https://central.sonatype.com/artifact/com.squareup.okhttp3/okhttp
okhttpVersion = '4.11.0' okhttpVersion = '4.12.0'
// https://central.sonatype.com/artifact/io.minio/minio // https://central.sonatype.com/artifact/io.minio/minio
minioVersion = '8.5.4' minioVersion = '8.5.7'
// https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-60 // https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-63
hibernateTypesVersion = '3.5.1' hibernateTypesVersion = '3.7.0'
// https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial // https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial
hibernateSpatialVersion = '6.2.5.Final' hibernateSpatialVersion = '6.4.1.Final'
// https://central.sonatype.com/artifact/org.locationtech.jts/jts-core // https://central.sonatype.com/artifact/org.locationtech.jts/jts-core
jtsVersion = '1.19.0' jtsVersion = '1.19.0'
// https://central.sonatype.com/artifact/com.github.liaochong/myexcel // https://central.sonatype.com/artifact/com.github.liaochong/myexcel
myexcelVersion = '4.3.0.RELEASE' myexcelVersion = '4.4.2'
// https://central.sonatype.com/artifact/org.jetbrains/annotations // https://central.sonatype.com/artifact/org.jetbrains/annotations
jetbrainsAnnotationsVersion = '24.0.1' jetbrainsAnnotationsVersion = '24.1.0'
// https://central.sonatype.com/artifact/org.apache.pdfbox/pdfbox // https://central.sonatype.com/artifact/org.apache.pdfbox/pdfbox
pdfboxVersion = '2.0.28' pdfboxVersion = '3.0.1'
// https://central.sonatype.com/artifact/net.bramp.ffmpeg/ffmpeg // https://central.sonatype.com/artifact/net.bramp.ffmpeg/ffmpeg
// FIXED: ffmpeg 4.x // FIXED: ffmpeg 4.x
ffmpegWrapperVersion = '0.7.0' ffmpegWrapperVersion = '0.8.0'
// https://central.sonatype.com/artifact/org.yaml/snakeyaml // https://central.sonatype.com/artifact/org.yaml/snakeyaml
snakeyamlVersion = '2.0' snakeyamlVersion = '2.2'
} }
allprojects { allprojects {
...@@ -69,8 +70,8 @@ allprojects { ...@@ -69,8 +70,8 @@ allprojects {
mavenLocal() mavenLocal()
// Nexus // Nexus
// maven { url 'http://10.111.102.83:8081/repository/aliyun-maven/' } // maven { url 'http://10.111.102.83:8081/repository/aliyun-maven/' }
maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' }
maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' }
mavenCentral() mavenCentral()
} }
...@@ -98,12 +99,12 @@ subprojects { ...@@ -98,12 +99,12 @@ subprojects {
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
} }
dependencyManagement { // dependencyManagement {
imports { // imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" // mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}" // mavenBom "de.codecentric:spring-boot-admin-dependencies:${springBootAdminVersion}"
} // }
} // }
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8' [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
"log": "conventional-changelog -p angular -i CHANGELOG.md -s" "log": "conventional-changelog -p angular -i CHANGELOG.md -s"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.4.0", "@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.4.0", "@commitlint/config-conventional": "^17.8.1",
"commitizen": "^4.2.6", "commitizen": "^4.3.0",
"conventional-changelog-cli": "^2.2.2", "conventional-changelog-cli": "^2.2.2",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^7.0.0", "cz-customizable": "^7.0.0",
"cz-git": "^1.4.1" "cz-git": "^1.8.0"
}, },
"config": { "config": {
"commitizen": { "commitizen": {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论