Commit 0a0c76f5 authored by liqin's avatar liqin 💬

bug fixed

parent 8a1edff7
......@@ -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();
ByteOutputStream byteOutputStream = new ByteOutputStream();
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
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();
ByteOutputStream byteOutputStream = new ByteOutputStream();
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
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";
......
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