Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
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
b0a6d1b9
Commit
b0a6d1b9
authored
Apr 06, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
00034b5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
FileUploadController.java
.../chnmuseum/party/web/controller/FileUploadController.java
+33
-1
VideoContentCatController.java
...useum/party/web/controller/VideoContentCatController.java
+2
-2
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/FileUploadController.java
View file @
b0a6d1b9
...
...
@@ -94,6 +94,14 @@ public class FileUploadController extends BaseController {
failureCount
++;
continue
;
}
if
(
file
.
getSize
()
==
0L
)
{
handleResult
.
setFileName
(
""
);
handleResult
.
setFileUrl
(
""
);
handleResult
.
setHandleResult
(
HANDLE_STATUS_ENUM
.
FAILURE
.
getName
());
handleResult
.
setDescription
(
"文件大小为0"
);
failureCount
++;
continue
;
}
String
extName
=
FilenameUtils
.
getExtension
(
originalFilename
);
boolean
anyMatch
=
Arrays
.
stream
(
DATUM_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
...
...
@@ -187,7 +195,7 @@ public class FileUploadController extends BaseController {
@RequiresPermissions
(
"file:image:upload"
)
@ApiOperation
(
value
=
"单图片上传(封面/缩略图)"
,
notes
=
"单图片上传(封面/缩略图)"
)
public
Map
<
String
,
Object
>
uploadImage
(
@RequestParam
(
value
=
"file"
)
MultipartFile
uploadFile
)
throws
Exception
{
if
(
uploadFile
==
null
||
uploadFile
.
getSize
()
==
0
)
{
if
(
uploadFile
==
null
||
uploadFile
.
getSize
()
==
0
L
)
{
throw
new
InterfaceException
(
RESPONSE_CODE_ENUM
.
SERVER_ERROR
.
getResultCode
(),
"没有文件可供上传"
);
}
String
fileName
=
uploadFile
.
getOriginalFilename
();
...
...
@@ -269,6 +277,14 @@ public class FileUploadController extends BaseController {
failureCount
++;
continue
;
}
if
(
file
.
getSize
()
==
0L
)
{
handleResult
.
setFileName
(
""
);
handleResult
.
setFileUrl
(
""
);
handleResult
.
setHandleResult
(
HANDLE_STATUS_ENUM
.
FAILURE
.
getName
());
handleResult
.
setDescription
(
"文件大小为0"
);
failureCount
++;
continue
;
}
String
extName
=
FilenameUtils
.
getExtension
(
originalFilename
);
boolean
anyMatch
=
Arrays
.
stream
(
AUDIO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
...
...
@@ -371,6 +387,14 @@ public class FileUploadController extends BaseController {
failureCount
++;
continue
;
}
if
(
file
.
getSize
()
==
0L
)
{
handleResult
.
setFileName
(
""
);
handleResult
.
setFileUrl
(
""
);
handleResult
.
setHandleResult
(
HANDLE_STATUS_ENUM
.
FAILURE
.
getName
());
handleResult
.
setDescription
(
"文件大小为0"
);
failureCount
++;
continue
;
}
String
extName
=
FilenameUtils
.
getExtension
(
originalFilename
);
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
...
...
@@ -471,6 +495,14 @@ public class FileUploadController extends BaseController {
failureCount
++;
continue
;
}
if
(
file
.
getSize
()
==
0L
)
{
handleResult
.
setFileName
(
""
);
handleResult
.
setFileUrl
(
""
);
handleResult
.
setHandleResult
(
HANDLE_STATUS_ENUM
.
FAILURE
.
getName
());
handleResult
.
setDescription
(
"文件大小为0"
);
failureCount
++;
continue
;
}
String
extName
=
FilenameUtils
.
getExtension
(
originalFilename
);
boolean
anyMatch
=
Arrays
.
stream
(
VIDEO_TYPE
).
anyMatch
(
s
->
Objects
.
equals
(
s
,
extName
.
toUpperCase
()));
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/VideoContentCatController.java
View file @
b0a6d1b9
...
...
@@ -119,8 +119,8 @@ public class VideoContentCatController extends BaseController {
lambdaQueryWrapper
=
lambdaQueryWrapper
.
select
(
VideoContent:
:
getId
).
select
(
VideoContent:
:
getVideoContentCopyrightOwnerId
);
List
<
VideoContent
>
videoContentList
=
this
.
videoContentService
.
list
(
lambdaQueryWrapper
);
if
(!
videoContentList
.
isEmpty
())
{
final
Set
<
String
>
asse
tCopyrightOwnerIdList
=
videoContentList
.
stream
().
map
(
VideoContent:
:
getVideoContentCopyrightOwnerId
).
collect
(
Collectors
.
toSet
());
List
<
CopyrightOwner
>
copyrightOwnerList
=
this
.
copyrightOwnerService
.
listByIds
(
asse
tCopyrightOwnerIdList
);
final
Set
<
String
>
videoConten
tCopyrightOwnerIdList
=
videoContentList
.
stream
().
map
(
VideoContent:
:
getVideoContentCopyrightOwnerId
).
collect
(
Collectors
.
toSet
());
List
<
CopyrightOwner
>
copyrightOwnerList
=
this
.
copyrightOwnerService
.
listByIds
(
videoConten
tCopyrightOwnerIdList
);
String
copyrightOwnerName
=
copyrightOwnerList
.
stream
().
map
(
CopyrightOwner:
:
getName
).
collect
(
Collectors
.
joining
(
"、"
));
videoContentCat
.
setCopyrightOwnerName
(
copyrightOwnerName
);
}
...
...
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