Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
461974c8
Commit
461974c8
authored
Jun 14, 2024
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二维码生成
parent
15000ac4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
FileUploadServiceImpl.java
.../v1/yifu/archives/service/impl/FileUploadServiceImpl.java
+10
-13
QrCodeUtil.java
...om/yifu/cloud/plus/v1/yifu/archives/utils/QrCodeUtil.java
+1
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/FileUploadServiceImpl.java
View file @
461974c8
...
...
@@ -92,20 +92,9 @@ public class FileUploadServiceImpl implements FileUploadService {
if
(
Common
.
isEmpty
(
fileName
))
{
return
R
.
failed
(
"文件名不能为空!"
);
}
if
(
fileName
.
length
()
>
100
)
{
return
R
.
failed
(
"文件名不能超过100个字符!"
);
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String
key
=
""
;
if
(
Common
.
isNotNull
(
filePath
))
{
key
=
filePath
+
"/"
+
System
.
currentTimeMillis
()
+
fileName
;
}
else
{
key
=
System
.
currentTimeMillis
()
+
fileName
;
}
if
(!
Common
.
checkFile
(
key
))
{
return
R
.
failed
(
"非法上传类型!"
);
}
String
key
=
System
.
currentTimeMillis
()
+
fileName
;
boolean
flag
=
ossUtil
.
uploadFileByStream
(
fileIn
,
key
,
null
);
FileVo
fileVo
;
TAttaInfo
attaInfo
;
...
...
@@ -171,10 +160,18 @@ public class FileUploadServiceImpl implements FileUploadService {
}
InputStream
in
=
codeUtil
.
createPng
(
url
);
try
{
return
this
.
uploadImg2
(
in
,
"mvp_qr"
,
CommonConstants
.
EIGHT_INT
,
domainId
,
name
);
return
this
.
uploadImg2
(
in
,
"mvp_qr"
,
CommonConstants
.
EIGHT_INT
,
domainId
,
"output_qrcode.png"
);
}
catch
(
IOException
e
)
{
log
.
error
(
"获取二维码失败"
,
e
);
return
R
.
failed
(
CommonConstants
.
RESULT_DATA_FAIL
);
}
finally
{
if
(
Common
.
isNotNull
(
in
)){
try
{
in
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
\ No newline at end of file
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/utils/QrCodeUtil.java
View file @
461974c8
...
...
@@ -61,6 +61,7 @@ public class QrCodeUtil {
File
file
=
new
File
(
"output_qrcode.png"
);
ImageIO
.
write
(
image
,
"PNG"
,
file
);
InputStream
in
=
new
FileInputStream
(
file
);
file
.
deleteOnExit
();
return
in
;
}
catch
(
IOException
e
)
{
log
.
error
(
"failed:生成二维码失败"
,
e
.
getMessage
());
...
...
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