Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
data-server
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
licc
data-server
Commits
3814c6d8
Commit
3814c6d8
authored
4 years ago
by
m1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台接口——用户与资讯后台接口
parent
71ad3ddd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
206 additions
and
15 deletions
+206
-15
UploadServiceImpl.java
...java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
+4
-5
wisenergy-service.iml
wisenergy-service/wisenergy-service.iml
+202
-10
No files found.
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UploadServiceImpl.java
View file @
3814c6d8
...
@@ -181,7 +181,6 @@ public class UploadServiceImpl implements UploadService {
...
@@ -181,7 +181,6 @@ public class UploadServiceImpl implements UploadService {
//过滤传入的邀请码带有“”的符号
//过滤传入的邀请码带有“”的符号
inviteCode
=
inviteCode
.
replace
(
"\""
,
""
).
replace
(
"\""
,
""
);
inviteCode
=
inviteCode
.
replace
(
"\""
,
""
).
replace
(
"\""
,
""
);
//获取上传图片数量,打印在控制台
//获取上传图片数量,打印在控制台
if
(
null
!=
files
&&!
""
.
equals
(
files
)){
System
.
out
.
println
(
"上传图片数量"
+
files
.
length
);
System
.
out
.
println
(
"上传图片数量"
+
files
.
length
);
//创建集合
//创建集合
List
<
Map
<
String
,
Object
>>
root
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
root
=
new
ArrayList
<
Map
<
String
,
Object
>>();
...
@@ -192,11 +191,11 @@ public class UploadServiceImpl implements UploadService {
...
@@ -192,11 +191,11 @@ public class UploadServiceImpl implements UploadService {
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>();
//一个文件上传的结果
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>();
//一个文件上传的结果
String
msg
=
""
;
//上传结果信息
String
msg
=
""
;
//上传结果信息
//上传图片不为空时
//上传图片不为空时
long
sa
=
0
;
Integer
sa
=
0
;
for
(
MultipartFile
file
:
files
)
{
for
(
MultipartFile
file
:
files
)
{
sa
=
file
.
getSize
(
);
sa
=
Math
.
toIntExact
(
file
.
getSize
()
);
}
}
if
(
sa
>
0
)
{
if
(
sa
>
0
&&
sa
!=
null
&&!
""
.
equals
(
sa
)
)
{
//遍历图片数据
//遍历图片数据
for
(
MultipartFile
file
:
files
)
{
for
(
MultipartFile
file
:
files
)
{
...
@@ -253,7 +252,7 @@ public class UploadServiceImpl implements UploadService {
...
@@ -253,7 +252,7 @@ public class UploadServiceImpl implements UploadService {
shopZxMapper
.
zxadd
(
zxUrl
,
zxField
,
inviteCode
,
zxDate
);
shopZxMapper
.
zxadd
(
zxUrl
,
zxField
,
inviteCode
,
zxDate
);
return
result
;
return
result
;
//用户只上传文字时
//用户只上传文字时
}
}
else
if
(
null
!=
zxField
&&
files
==
null
)
{
}
else
if
(
null
!=
zxField
&&
files
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
wisenergy-service/wisenergy-service.iml
View file @
3814c6d8
This diff is collapsed.
Click to expand it.
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