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
0a0c76f5
Commit
0a0c76f5
authored
Apr 08, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
8a1edff7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
AssetController.java
...nergy/chnmuseum/party/web/controller/AssetController.java
+4
-5
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/AssetController.java
View file @
0a0c76f5
...
...
@@ -11,7 +11,6 @@ import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.tobato.fastdfs.domain.fdfs.MetaData
;
import
com.sun.xml.internal.messaging.saaj.util.ByteOutputStream
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -106,9 +105,9 @@ public class AssetController extends BaseController {
for
(
int
i
=
0
;
i
<
assetList
.
size
();
i
++)
{
final
Asset
asset
=
assetList
.
get
(
i
);
final
String
fileUrl
=
asset
.
getFileUrl
();
Byte
OutputStream
byteOutputStream
=
new
Byte
OutputStream
();
Byte
ArrayOutputStream
byteOutputStream
=
new
ByteArray
OutputStream
();
FastDFSUtils
.
downloadFile
(
fileUrl
,
byteOutputStream
);
inputStreams
[
i
]
=
VideoEncryptUtil
.
encrypt
(
byteOutputStream
.
newInputStream
(
),
VideoEncryptUtil
.
cipher
);
inputStreams
[
i
]
=
VideoEncryptUtil
.
encrypt
(
new
ByteArrayInputStream
(
byteOutputStream
.
toByteArray
()
),
VideoEncryptUtil
.
cipher
);
final
Set
<
MetaData
>
fileMetaData
=
FastDFSUtils
.
getFileMetaData
(
fileUrl
);
String
md5
=
fileMetaData
.
stream
().
filter
(
x
->
"MD5"
.
equals
(
x
.
getName
())).
map
(
MetaData:
:
getValue
).
findFirst
().
get
();
paths
[
i
]
=
md5
+
".chnmuseum"
;
...
...
@@ -134,9 +133,9 @@ public class AssetController extends BaseController {
for
(
int
i
=
0
;
i
<
assetList
.
size
();
i
++)
{
final
Asset
asset
=
assetList
.
get
(
i
);
final
String
fileUrl
=
asset
.
getFileUrl
();
Byte
OutputStream
byteOutputStream
=
new
Byte
OutputStream
();
Byte
ArrayOutputStream
byteOutputStream
=
new
ByteArray
OutputStream
();
FastDFSUtils
.
downloadFile
(
fileUrl
,
byteOutputStream
);
inputStreams
[
i
]
=
VideoEncryptUtil
.
encrypt
(
byteOutputStream
.
newInputStream
(
),
VideoEncryptUtil
.
cipher
);
inputStreams
[
i
]
=
VideoEncryptUtil
.
encrypt
(
new
ByteArrayInputStream
(
byteOutputStream
.
toByteArray
()
),
VideoEncryptUtil
.
cipher
);
final
Set
<
MetaData
>
fileMetaData
=
FastDFSUtils
.
getFileMetaData
(
fileUrl
);
String
md5
=
fileMetaData
.
stream
().
filter
(
x
->
"MD5"
.
equals
(
x
.
getName
())).
map
(
MetaData:
:
getValue
).
findFirst
().
get
();
paths
[
i
]
=
md5
+
".chnmuseum"
;
...
...
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