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