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
77516475
Commit
77516475
authored
Apr 22, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
247fbba6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
AssetMapper.java
src/main/java/cn/chnmuseum/party/mapper/AssetMapper.java
+1
-1
AssetController.java
...va/cn/chnmuseum/party/web/controller/AssetController.java
+4
-10
No files found.
src/main/java/cn/chnmuseum/party/mapper/AssetMapper.java
View file @
77516475
...
...
@@ -36,7 +36,7 @@ public interface AssetMapper extends BaseMapper<Asset> {
@Select
(
"<script>"
+
"SELECT b.*, o.code as organ_code, o.`name` as organ_name "
+
"FROM t_box_operation b, t_organ o "
+
"where b.organ_id = o.id and b.p
rivate
_key IS NOT NULL"
+
"where b.organ_id = o.id and b.p
ublic
_key IS NOT NULL"
+
"</script>"
)
List
<
TBoxOperation
>
selectBoxListByOrgan
();
...
...
src/main/java/cn/chnmuseum/party/web/controller/AssetController.java
View file @
77516475
package
cn
.
chnmuseum
.
party
.
web
.
controller
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.util.ZipUtil
;
import
cn.chnmuseum.party.common.dfs.FastDFSUtils
;
import
cn.chnmuseum.party.common.log.MethodLog
;
import
cn.chnmuseum.party.common.log.OperModule
;
...
...
@@ -14,6 +12,8 @@ import cn.chnmuseum.party.model.Asset;
import
cn.chnmuseum.party.model.TBoxOperation
;
import
cn.chnmuseum.party.service.AssetService
;
import
cn.chnmuseum.party.web.controller.base.BaseController
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.util.ZipUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
...
...
@@ -28,7 +28,6 @@ import org.springframework.http.MediaType;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
...
...
@@ -137,9 +136,7 @@ public class AssetController extends BaseController {
FastDFSUtils
.
downloadFile
(
asset
.
getFileUrlCrypto
(),
byteOutputStream
);
map
.
put
(
asset
.
getMd5
()
+
".chnmuseum"
,
VideoEncryptUtil
.
encrypt
(
new
ByteArrayInputStream
(
byteOutputStream
.
toByteArray
()),
VideoEncryptUtil
.
cipher
));
}
String
[]
paths
=
map
.
keySet
().
toArray
(
new
String
[
0
]);
InputStream
[]
ins
=
map
.
values
().
toArray
(
new
InputStream
[
0
]);
ZipUtil
.
zip
(
response
.
getOutputStream
(),
paths
,
ins
);
ZipUtil
.
zip
(
response
.
getOutputStream
(),
map
.
keySet
().
toArray
(
new
String
[
0
]),
map
.
values
().
toArray
(
new
InputStream
[
0
]));
}
@ApiOperation
(
value
=
"导出所有机顶盒的文件加密密钥"
,
notes
=
"导出所有机顶盒的文件加密密钥"
)
...
...
@@ -155,10 +152,7 @@ public class AssetController extends BaseController {
for
(
TBoxOperation
tBoxOperation
:
tBoxOperationList
)
{
map
.
put
(
tBoxOperation
.
getOrganName
()
+
"-"
+
tBoxOperation
.
getMac
().
replaceAll
(
":|-"
,
"_"
)
+
".cipher"
,
IoUtil
.
toStream
(
RSAUtils
.
encrypt
(
VideoEncryptUtil
.
cipher
,
tBoxOperation
.
getPublicKey
()),
StandardCharsets
.
UTF_8
));
}
ServletOutputStream
outputStream
=
response
.
getOutputStream
();
String
[]
paths
=
map
.
keySet
().
toArray
(
new
String
[
0
]);
InputStream
[]
ins
=
map
.
values
().
toArray
(
new
InputStream
[
0
]);
ZipUtil
.
zip
(
outputStream
,
paths
,
ins
);
ZipUtil
.
zip
(
response
.
getOutputStream
(),
map
.
keySet
().
toArray
(
new
String
[
0
]),
map
.
values
().
toArray
(
new
InputStream
[
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