记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
c9ca34d9
Commit
c9ca34d9
authored
Jul 15, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口格式更改
parent
85d8cace
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
48 deletions
+43
-48
AlOssController.java
...ce/platform/controller/basicServices/AlOssController.java
+43
-48
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/basicServices/AlOssController.java
View file @
c9ca34d9
...
@@ -83,14 +83,8 @@ public class AlOssController {
...
@@ -83,14 +83,8 @@ public class AlOssController {
// file md5
// file md5
String
fileMD5
=
FilesUtils
.
getFileMD5
(
fileNew
);
String
fileMD5
=
FilesUtils
.
getFileMD5
(
fileNew
);
PlatformOssFiles
platformOssFiles
=
platformOssFilesMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
PlatformOssFiles
.
class
).
eq
(
PlatformOssFiles:
:
getMd5str
,
fileMD5
));
PlatformOssFiles
platformOssFiles
=
platformOssFilesMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
PlatformOssFiles
.
class
).
eq
(
PlatformOssFiles:
:
getMd5str
,
fileMD5
));
if
(
null
!=
platformOssFiles
)
{
UploadVo
uploadVo
=
new
UploadVo
();
UploadVo
uploadVo
=
new
UploadVo
();
uploadVo
.
setOssPath
(
platformOssFiles
.
getOssPath
());
if
(
null
==
platformOssFiles
)
{
uploadVo
.
setSize
(
platformOssFiles
.
getSize
());
uploadVo
.
setContentType
(
platformOssFiles
.
getContentType
());
return
ResponseDto
.
success
(
uploadVo
);
}
String
filename
=
file
.
getResource
().
getFilename
();
// time.jpeg
String
filename
=
file
.
getResource
().
getFilename
();
// time.jpeg
//这里文件名用了uuid 防止重复,可以根据自己的需要来写
//这里文件名用了uuid 防止重复,可以根据自己的需要来写
String
uploadName
=
UUID
.
randomUUID
()
+
filename
.
substring
(
filename
.
lastIndexOf
(
"."
));
// 078a77e0-cf80-481b-824c-5935247cff15.jpeg
String
uploadName
=
UUID
.
randomUUID
()
+
filename
.
substring
(
filename
.
lastIndexOf
(
"."
));
// 078a77e0-cf80-481b-824c-5935247cff15.jpeg
...
@@ -107,7 +101,7 @@ public class AlOssController {
...
@@ -107,7 +101,7 @@ public class AlOssController {
StringBuilder
sbStyle
=
new
StringBuilder
();
StringBuilder
sbStyle
=
new
StringBuilder
();
Formatter
styleFormatter
=
new
Formatter
(
sbStyle
);
Formatter
styleFormatter
=
new
Formatter
(
sbStyle
);
String
styleType
=
"image/resize,w_"
+
resize
;
String
styleType
=
"image/resize,w_"
+
resize
;
//
String styleType = "image/resize,m_fixed,w_100,h_100";
//
String styleType = "image/resize,m_fixed,w_100,h_100";
styleFormatter
.
format
(
"%s|sys/saveas,o_%s,b_%s"
,
styleType
,
styleFormatter
.
format
(
"%s|sys/saveas,o_%s,b_%s"
,
styleType
,
BinaryUtil
.
toBase64String
(
uploadpath
.
getBytes
()),
BinaryUtil
.
toBase64String
(
uploadpath
.
getBytes
()),
BinaryUtil
.
toBase64String
(
buckName
.
getBytes
()));
BinaryUtil
.
toBase64String
(
buckName
.
getBytes
()));
...
@@ -132,9 +126,10 @@ public class AlOssController {
...
@@ -132,9 +126,10 @@ public class AlOssController {
platformOssFilesDate
.
setCreatedAt
(
DateUtil
.
getNowTime
());
platformOssFilesDate
.
setCreatedAt
(
DateUtil
.
getNowTime
());
platformOssFilesMapper
.
insert
(
platformOssFilesDate
);
platformOssFilesMapper
.
insert
(
platformOssFilesDate
);
// 返回值
UploadVo
uploadVo
=
new
UploadVo
();
BeanUtils
.
copyProperties
(
platformOssFilesDate
,
uploadVo
);
BeanUtils
.
copyProperties
(
platformOssFilesDate
,
uploadVo
);
}
else
{
BeanUtils
.
copyProperties
(
platformOssFiles
,
uploadVo
);
}
return
ResponseDto
.
success
(
uploadVo
);
return
ResponseDto
.
success
(
uploadVo
);
}
}
...
...
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