Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
19cc28cd
提交
19cc28cd
authored
12月 30, 2024
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: upgrade deps(SpringBoot v3.4.1)
上级
d995da9e
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
72 行增加
和
30 行删除
+72
-30
.gitattributes
.gitattributes
+2
-0
UploadProcessServiceImpl.java
...m/yiring/app/service/upload/UploadProcessServiceImpl.java
+2
-2
HealthController.java
...main/java/com/yiring/app/web/common/HealthController.java
+11
-7
build.gradle
build.gradle
+13
-13
gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.jar
+0
-0
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
gradlew
gradlew
+5
-2
gradlew.bat
gradlew.bat
+2
-0
Auths.java
modules/auth/src/main/java/com/yiring/auth/util/Auths.java
+18
-0
Specifications.java
...src/main/java/com/yiring/common/utils/Specifications.java
+1
-0
SwaggerConfig.java
...rc/main/java/com/yiring/common/swagger/SwaggerConfig.java
+3
-3
MinioController.java
.../src/main/java/com/yiring/common/web/MinioController.java
+8
-1
Retriever.java
.../util/src/main/java/com/yiring/common/core/Retriever.java
+4
-0
settings.gradle
settings.gradle
+2
-1
没有找到文件。
.gitattributes
浏览文件 @
19cc28cd
# public/* linguist-vendored
*.bat text eol=crlf
*.jar binary
* text=auto eol=lf
app/src/main/java/com/yiring/app/service/upload/UploadProcessServiceImpl.java
浏览文件 @
19cc28cd
...
...
@@ -209,8 +209,8 @@ public class UploadProcessServiceImpl implements UploadProcessService {
"copy"
,
"-tune"
,
"fastdecode"
,
"-hls_wrap"
,
"0"
,
//
"-hls_wrap",
//
"0",
"-hls_time"
,
"5"
,
"-hls_list_size"
,
...
...
app/src/main/java/com/yiring/app/web/common/HealthController.java
浏览文件 @
19cc28cd
...
...
@@ -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;
// }
...
...
build.gradle
浏览文件 @
19cc28cd
...
...
@@ -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
=
'202
3.0.3
'
springCloudVersion
=
'202
4.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.1
6.0
'
sentryVersion
=
'7.1
8.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.2
5
'
swaggerAnnotationsVersion
=
'2.2.2
7
'
// 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.3
2
'
hutoolVersion
=
'5.8.3
5
'
// 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.1
3
'
minioVersion
=
'8.5.1
4
'
// 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
()
}
}
...
...
gradle/wrapper/gradle-wrapper.jar
浏览文件 @
19cc28cd
No preview for this file type
gradle/wrapper/gradle-wrapper.properties
浏览文件 @
19cc28cd
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//mirrors.aliyun.com/gradle/distributions/v8.1
0.1/gradle-8.10
.1-bin.zip
distributionUrl
=
https
\:
//mirrors.aliyun.com/gradle/distributions/v8.1
1.1/gradle-8.11
.1-bin.zip
networkTimeout
=
10000
validateDistributionUrl
=
true
zipStoreBase
=
GRADLE_USER_HOME
...
...
gradlew
浏览文件 @
19cc28cd
...
...
@@ -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
...
...
gradlew.bat
浏览文件 @
19cc28cd
...
...
@@ -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 ##########################################################################
...
...
modules/auth/src/main/java/com/yiring/auth/util/Auths.java
浏览文件 @
19cc28cd
...
...
@@ -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}
*
...
...
modules/common/core/src/main/java/com/yiring/common/utils/Specifications.java
浏览文件 @
19cc28cd
...
...
@@ -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
();
};
}
...
...
modules/common/doc/src/main/java/com/yiring/common/swagger/SwaggerConfig.java
浏览文件 @
19cc28cd
...
...
@@ -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
;
...
...
modules/common/minio/src/main/java/com/yiring/common/web/MinioController.java
浏览文件 @
19cc28cd
...
...
@@ -154,9 +154,16 @@ public class MinioController {
// 合并后的文件已存在,校验 MD5 是否一致
if
(
Objects
.
equals
(
chunkParam
.
getMd5
(),
FileUtils
.
getFileMd5
(
file
)))
{
// MD5 一致
GetObjectResponse
response
=
minio
.
getObject
(
bucket
,
object
+
".info"
);
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
);
}
}
}
...
...
modules/common/util/src/main/java/com/yiring/common/core/Retriever.java
浏览文件 @
19cc28cd
...
...
@@ -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
(),
...
...
settings.gradle
浏览文件 @
19cc28cd
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论