feat(可回溯): 可回溯
修改文件读取方式
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.wabestway.recall.web;
|
package com.wabestway.recall.web;
|
||||||
|
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.wabestway.commons.http.ResObj;
|
import com.wabestway.commons.http.ResObj;
|
||||||
@@ -145,7 +146,8 @@ public class OrderController {
|
|||||||
File file = new File(tempDir.toFile(), "video.mp4");
|
File file = new File(tempDir.toFile(), "video.mp4");
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
log.info(String.valueOf(file.length()));
|
log.info(String.valueOf(file.length()));
|
||||||
byte[] fileBytes = Files.readAllBytes(file.toPath());
|
//byte[] fileBytes = Files.readAllBytes(file.toPath());
|
||||||
|
byte[] fileBytes = FileUtil.readBytes(file);
|
||||||
String titles = fo.getOrderId() + ".mp4";
|
String titles = fo.getOrderId() + ".mp4";
|
||||||
UploadFileDTO uploadFileDTO = new UploadFileDTO(fileBytes, "RECALL", titles);
|
UploadFileDTO uploadFileDTO = new UploadFileDTO(fileBytes, "RECALL", titles);
|
||||||
|
|
||||||
@@ -159,6 +161,7 @@ public class OrderController {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
log.error(e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
// 删除临时目录
|
// 删除临时目录
|
||||||
Files.walk(tempDir)
|
Files.walk(tempDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user