提交 19cc28cd 作者: 方治民

chore: upgrade deps(SpringBoot v3.4.1)

上级 d995da9e
# public/* linguist-vendored
*.bat text eol=crlf
*.jar binary
* text=auto eol=lf
......@@ -209,8 +209,8 @@ public class UploadProcessServiceImpl implements UploadProcessService {
"copy",
"-tune",
"fastdecode",
"-hls_wrap",
"0",
// "-hls_wrap",
// "0",
"-hls_time",
"5",
"-hls_list_size",
......
......@@ -46,7 +46,8 @@ public class HealthController {
redis.info();
data.put("redis", "up");
} catch (Exception e) {
data.put("redis", "down");
log.error("[Health] redis usability fail: {}", e.getMessage());
data.put("redis", "down: " + e.getMessage());
health = false;
}
......@@ -55,25 +56,28 @@ public class HealthController {
userRepository.count();
data.put("database", "up");
} catch (Exception e) {
data.put("database", "down");
log.error("[Health] database usability fail: {}", e.getMessage());
data.put("database", "down: " + e.getMessage());
health = false;
}
// MinIO
try {
boolean result = minio.isValid();
data.put("minio", result ? "up" : "down");
minio.isValid();
data.put("minio", "up");
} catch (Exception e) {
data.put("minio", "down");
log.error("[Health] minio usability fail: {}", e.getMessage());
data.put("minio", "down: " + e.getMessage());
health = false;
}
// // RabbitMQ
// RabbitMQ
// try {
// rabbitTemplate.send(new Message("health".getBytes()));
// data.put("rabbitmq", "up");
// } catch (Exception e) {
// data.put("rabbitmq", "down");
// log.error("[Health] rabbitmq usability fail: {}", e.getMessage());
// data.put("rabbitmq", "down: " + e.getMessage());
// health = false;
// }
......
......@@ -2,10 +2,10 @@ plugins {
id 'java'
id 'java-library'
// https://start.spring.io
id 'org.springframework.boot' version '3.3.5'
id 'org.graalvm.buildtools.native' version '0.10.3'
id 'org.springframework.boot' version '3.4.1'
id 'org.graalvm.buildtools.native' version '0.10.4'
// https://plugins.gradle.org/plugin/io.spring.dependency-management
id 'io.spring.dependency-management' version '1.1.6'
id 'io.spring.dependency-management' version '1.1.7'
// https://plugins.gradle.org/plugin/com.diffplug.spotless
id "com.diffplug.spotless" version "6.25.0"
// https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties
......@@ -25,33 +25,33 @@ ext {
// SpringCloud
// https://start.spring.io/
springCloudVersion = '2023.0.3'
springCloudVersion = '2024.0.0'
// SpringBootAdmin
// https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server
springBootAdminVersion = '3.3.4'
springBootAdminVersion = '3.4.1'
// Sentry
// https://central.sonatype.com/artifact/io.sentry/sentry-spring-boot-starter-jakarta
sentryVersion = '7.16.0'
sentryVersion = '7.18.1'
// Dependencies
// https://central.sonatype.com/artifact/com.github.xiaoymin/knife4j-openapi3-jakarta-spring-boot-starter
knife4jOpen3Version = '4.5.0'
// https://central.sonatype.com/artifact/io.swagger.core.v3/swagger-annotations
swaggerAnnotationsVersion = '2.2.25'
swaggerAnnotationsVersion = '2.2.27'
// https://central.sonatype.com/artifact/cn.dev33/sa-token-spring-boot3-starter
saTokenVersion = '1.39.0'
// https://central.sonatype.com/artifact/cn.hutool/hutool-core
hutoolVersion = '5.8.32'
hutoolVersion = '5.8.35'
// https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2
fastJsonVersion = '2.0.53'
// https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '2.4.1'
xxlJobVersion = '2.4.2'
// https://central.sonatype.com/artifact/io.minio/minio
minioVersion = '8.5.13'
minioVersion = '8.5.14'
// https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-63
hibernateTypesVersion = '3.8.3'
hibernateTypesVersion = '3.9.0'
// https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial
hibernateSpatialVersion = '6.5.3.Final'
// https://central.sonatype.com/artifact/org.locationtech.jts/jts-core
......@@ -59,7 +59,7 @@ ext {
// https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts
jacksonDatatypeJtsVersion = '1.2.10'
// https://central.sonatype.com/artifact/com.github.liaochong/myexcel
myexcelVersion = '4.5.3'
myexcelVersion = '4.5.6'
// https://central.sonatype.com/artifact/org.jetbrains/annotations
jetbrainsAnnotationsVersion = '26.0.1'
// https://central.sonatype.com/artifact/org.apache.pdfbox/pdfbox
......@@ -84,8 +84,8 @@ allprojects {
mavenLocal()
// Nexus
// 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://mirrors.cloud.tencent.com/nexus/repository/maven-public/' }
mavenCentral()
}
}
......
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://mirrors.aliyun.com/gradle/distributions/v8.10.1/gradle-8.10.1-bin.zip
distributionUrl=https\://mirrors.aliyun.com/gradle/distributions/v8.11.1/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
......
......@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
......@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
......@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
......
......@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
......
......@@ -118,6 +118,24 @@ public class Auths {
}
/**
* 检查用户是否拥有指定角色
*
* @param user 用户
* @param roles 角色列表
* @return 是否拥有指定角色
*/
public boolean matchRole(User user, List<String> roles) {
return user
.getRoles()
.stream()
.anyMatch(role ->
!Boolean.TRUE.equals(role.getDisabled()) &&
!Boolean.TRUE.equals(role.getDeleted()) &&
roles.contains(role.getUid())
);
}
/**
* 检查当前登录用户是否为管理员
* {@link this.isAdmin}
*
......
......@@ -98,6 +98,7 @@ public class Specifications {
fn.apply(root, query, cb, predicates);
}
assert query != null;
return query.where(predicates.toArray(new Predicate[0])).getRestriction();
};
}
......
......@@ -48,15 +48,15 @@ public class SwaggerConfig implements CommandLineRunner {
@Value("${server.address:}")
String serverAddress;
@Value("${server.servlet.context-path:}")
String path;
@Value("${spring.application.name}")
String applicationName;
@Value("${server.port}")
String port;
@Value("${server.servlet.context-path}")
String path;
@Getter
@Value("${app.version}")
String appVersion;
......
......@@ -154,9 +154,16 @@ public class MinioController {
// 合并后的文件已存在,校验 MD5 是否一致
if (Objects.equals(chunkParam.getMd5(), FileUtils.getFileMd5(file))) {
// MD5 一致
GetObjectResponse response = minio.getObject(bucket, object + ".info");
JSONObject info = JSONObject.parseObject(IoUtil.read(response, StandardCharsets.UTF_8));
return Result.ok(minio.getURI(info.getString("targetObject"), bucket));
String infoFile = object + ".info";
try {
GetObjectResponse response = minio.getObject(bucket, infoFile);
JSONObject info = JSONObject.parseObject(IoUtil.read(response, StandardCharsets.UTF_8));
return Result.ok(minio.getURI(info.getString("targetObject"), bucket));
} catch (Exception e) {
log.warn("获取合并后的文件描述信息失败, {}: {}, 重新执行合并操作", infoFile, e.getMessage());
// 删除文件,重新执行合并操作
FileUtil.del(file);
}
}
}
......
......@@ -82,6 +82,10 @@ public class Retriever {
// 没有添加保底恢复实现的情况下,抛出原始异常
Throwable throwable = ctx.getLastThrowable();
if (throwable == null) {
throw new RuntimeException("retry fail");
}
log.warn(
"[Retriever] execute fail, retry count: {}, e: {}",
ctx.getRetryCount(),
......
pluginManagement {
repositories {
// maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://maven.aliyun.com/repository/spring-plugin" }
gradlePluginPortal()
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论