Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
szpt
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
以墨为白
szpt
Commits
f4dd47a7
Commit
f4dd47a7
authored
Dec 28, 2024
by
以墨为白
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片上传-bug优化
parent
bd47a5be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/main/java/com/zksy/szpt/service/ImageUploadService.java
src/main/java/com/zksy/szpt/service/ImageUploadService.java
+2
-2
src/test/java/com/zksy/szpt/MainTest.java
src/test/java/com/zksy/szpt/MainTest.java
+1
-1
No files found.
src/main/java/com/zksy/szpt/service/ImageUploadService.java
View file @
f4dd47a7
...
...
@@ -39,7 +39,7 @@ public class ImageUploadService {
})
.
onErrorResume
(
Exception
.
class
,
ex
->
{
System
.
err
.
println
(
"General Exception: "
+
ex
.
getMessage
());
return
Mono
.
error
(
new
NotificationException
(
uploadImageDTO
.
getImagePath
()
+
",An error occurred while downloading the file"
));
return
Mono
.
error
(
new
NotificationException
(
ex
.
getMessage
()
));
});
XxImgfile
xxImgfile
=
new
XxImgfile
();
...
...
@@ -54,7 +54,7 @@ public class ImageUploadService {
xxImgfile
.
setData
(
fileContent
);
return
xxImgfileMapper
.
insert
(
xxImgfile
);
}
catch
(
Exception
e
)
{
throw
new
NotificationException
(
uploadImageDTO
.
getImagePath
()
+
",An error occurred while downloading the file"
);
throw
new
NotificationException
(
e
.
getCause
().
getMessage
()
);
}
// 将文件内容插入数据库
// fileContentMono.flatMap(fileContent -> {
...
...
src/test/java/com/zksy/szpt/MainTest.java
View file @
f4dd47a7
...
...
@@ -94,7 +94,7 @@ public class MainTest {
Assertions
.
assertNotNull
(
secretKey
,
"appId不存在"
);
//断言appId存在,为空直接抛出异常不进行下一步测试,提高测试效率
//请求参数
UploadImageDTO
uploadImageDTO
=
new
UploadImageDTO
();
uploadImageDTO
.
setImagePath
(
"
http://192.168.168.211/guoqing1.jpg
"
);
uploadImageDTO
.
setImagePath
(
""
);
uploadImageDTO
.
setImageType
(
ListImageType
.
FACE
);
String
json
=
null
;
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment