Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
cfld-region-outline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
cfld-backend
cfld-region-outline
Commits
b1329054
Commit
b1329054
authored
Jan 05, 2024
by
yaobaizheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片时间计算
parent
812889a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
UploadServiceImpl.java
...y/admin/moudle/system/service/impl/UploadServiceImpl.java
+6
-3
No files found.
src/main/java/com/lyy/admin/moudle/system/service/impl/UploadServiceImpl.java
View file @
b1329054
...
...
@@ -62,7 +62,7 @@ public class UploadServiceImpl implements UploadService {
}
else
{
String
newFile
=
IdUtil
.
simpleUUID
();
String
newFilename
=
newFile
+
fileLastType
;
TimeInterval
timer
=
DateUtil
.
timer
();
//将MultipartFile转为File,存储为本地临时文件
String
localDir
=
tempFilePath
+
newFilename
;
File
file
=
new
File
(
localDir
);
...
...
@@ -72,13 +72,16 @@ public class UploadServiceImpl implements UploadService {
String
newFilename1
=
IdUtil
.
simpleUUID
()
+
".jpg"
;
String
localDir1
=
tempFilePath
+
newFilename1
;
File
file1
=
FileUtil
.
file
(
localDir1
);
TimeInterval
timer
=
DateUtil
.
timer
();
System
.
out
.
println
(
"图片存储与新建"
+
timer
.
interval
());
TimeInterval
timer1
=
DateUtil
.
timer
();
Img
.
from
(
file
).
setQuality
(
1
).
write
(
file1
);
System
.
out
.
println
(
timer
.
interval
());
System
.
out
.
println
(
"图片压缩"
+
timer1
.
interval
());
TimeInterval
timer2
=
DateUtil
.
timer
();
InputStream
inputStream1
=
new
FileInputStream
(
localDir1
);
filePath
=
"/"
+
date
+
"/"
+
newFile
+
".jpg"
;
obsUtils
.
ObsUpload
(
bucketName
,
rootPath
+
filePath
,
inputStream1
);
System
.
out
.
println
(
"图片上传"
+
timer2
.
interval
());
//删除临时文件
CompletableFuture
.
runAsync
(()->
{
...
...
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