Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
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
platform
hg-smart
Commits
defef165
Commit
defef165
authored
Aug 20, 2024
by
江和松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APP段上传附件代码修改
parent
ee49ba16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
FileUploadController.java
...va/com/baosight/hggp/controller/FileUploadController.java
+10
-4
No files found.
src/main/java/com/baosight/hggp/controller/FileUploadController.java
View file @
defef165
...
...
@@ -16,9 +16,11 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
net.sf.json.JSONObject
;
import
org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -30,7 +32,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping
({
"/upload/file"
})
public
class
FileUploadController
{
/**
* 更具docId上传文件
*
...
...
@@ -44,7 +46,11 @@ public class FileUploadController {
JSONObject
upload
=
new
JSONObject
();
String
projectEnv
=
ProjectInfo
.
getProjectEnv
();
if
(
CommonConstant
.
projectEnv
.
RUN
.
equalsIgnoreCase
(
projectEnv
))
{
upload
=
UploadUtils
.
upload
((
CommonsMultipartFile
)
file
);
Iterator
multiFileIterator
=
((
DefaultMultipartHttpServletRequest
)
request
).
getMultiFileMap
().
get
(
"uploadFile"
).
iterator
();
while
(
multiFileIterator
.
hasNext
())
{
CommonsMultipartFile
multipartFile
=
(
CommonsMultipartFile
)
multiFileIterator
.
next
();
upload
=
UploadUtils
.
upload
(
multipartFile
);
}
}
else
{
upload
=
UploadUtils
.
uploadFile
(
request
);
}
...
...
@@ -58,7 +64,7 @@ public class FileUploadController {
return
resultMap
;
}
}
/**
* @param content
* @return
...
...
@@ -75,5 +81,5 @@ public class FileUploadController {
return
resultMap
;
}
}
}
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