Commit 30c210e7 authored by liqin's avatar liqin 💬

bug fixed

parent 80e567b0
......@@ -7,12 +7,12 @@ import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.util.RSAUtils;
import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import cn.wisenergy.chnmuseum.party.common.video.VideoEncryptUtil;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.TBoxOperation;
import cn.wisenergy.chnmuseum.party.service.AssetService;
import cn.wisenergy.chnmuseum.party.service.TBoxOperationService;
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;
......@@ -36,6 +36,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -54,14 +55,9 @@ import java.util.Map;
@Api(tags = {"视频文件汇出接口"})
public class AssetController extends BaseController {
private static final String BASE_STRING = "1234567890abcdef";
@Resource
private AssetService assetService;
@Resource
private TBoxOperationService tBoxOperationService;
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
......@@ -131,7 +127,8 @@ public class AssetController extends BaseController {
@MethodLog(operModule = OperModule.VIDEOREMIT, operType = OperType.VIDEO_EXPORT)
public void downloadByGet(@RequestParam("idList") List<String> idList, HttpServletResponse response) throws IOException {
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + URLEncoder.encode("video.zip", "UTF-8"));
final String fileName = TimeUtils.format(LocalDateTime.now(), TimeUtils.FORMAT_ONE) + "视频集.zip";
response.addHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
final Map<String, InputStream> map = new LinkedHashMap<>(idList.size());
final List<Asset> assetList = assetService.listByIds(idList);
......@@ -156,7 +153,7 @@ public class AssetController extends BaseController {
final List<TBoxOperation> tBoxOperationList = assetService.listBoxByOrgan();
final Map<String, InputStream> map = new LinkedHashMap<>(tBoxOperationList.size());
for (TBoxOperation tBoxOperation : tBoxOperationList) {
map.put(tBoxOperation.getOrganName() + ".cipher", IoUtil.toStream(RSAUtils.encrypt(VideoEncryptUtil.cipher, tBoxOperation.getPublicKey()), StandardCharsets.UTF_8));
map.put(tBoxOperation.getOrganName() + "_" + tBoxOperation.getMac() + ".cipher", IoUtil.toStream(RSAUtils.encrypt(VideoEncryptUtil.cipher, tBoxOperation.getPublicKey()), StandardCharsets.UTF_8));
}
ServletOutputStream outputStream = response.getOutputStream();
String[] paths = map.keySet().toArray(new String[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment