Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
chnmuseum-party
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
liqin
chnmuseum-party
Commits
a2c846b0
Commit
a2c846b0
authored
Apr 12, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
a8a0cdd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+15
-0
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
a2c846b0
...
...
@@ -399,6 +399,14 @@ public class FileUploadController extends BaseController {
if
(
files
==
null
||
files
.
length
==
0
)
{
return
getFailResult
(
"没有文件可供上传"
);
}
if
(
files
.
length
==
1
)
{
String
extName
=
FilenameUtils
.
getExtension
(
files
[
0
].
getOriginalFilename
());
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
if
(!
anyMatch
)
{
return
getFailResult
(
"目前仅支持"
+
String
.
join
(
"、"
,
VIDEO_TYPE
)
+
"格式"
);
}
}
final
boolean
matchChinese
=
Arrays
.
stream
(
files
).
anyMatch
(
s
->
Objects
.
requireNonNull
(
s
.
getOriginalFilename
()).
contains
(
"汉语"
));
if
(!
matchChinese
)
{
return
getFailResult
(
"文件必须包含汉语视频"
);
...
...
@@ -524,6 +532,13 @@ public class FileUploadController extends BaseController {
if
(
files
==
null
||
files
.
length
==
0
)
{
return
getFailResult
(
"没有文件可供上传"
);
}
if
(
files
.
length
==
1
)
{
String
extName
=
FilenameUtils
.
getExtension
(
files
[
0
].
getOriginalFilename
());
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
if
(!
anyMatch
)
{
return
getFailResult
(
"目前仅支持"
+
String
.
join
(
"、"
,
VIDEO_TYPE
)
+
"格式"
);
}
}
int
successCount
=
0
;
int
failureCount
=
0
;
...
...
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