|
|
@@ -30,7 +30,6 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
-import org.springframework.mock.web.MockMultipartFile;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@@ -38,7 +37,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.util.List;
|
|
|
@@ -257,15 +255,14 @@ public class OrderController extends BaseWebController {
|
|
|
if (pos != -1) {
|
|
|
suffix = file.getOriginalFilename().substring(pos);
|
|
|
}
|
|
|
- File tempFile = File.createTempFile("temp_", "."+suffix);
|
|
|
+ File tempFile = File.createTempFile("temp_", suffix);
|
|
|
file.transferTo(tempFile);
|
|
|
if(suffix.indexOf("mp4") != -1){
|
|
|
//视频处理
|
|
|
File imageFile = ossUtils.generateCover(tempFile);
|
|
|
dto = distinctionService.checkImg(imageFile,orderId,uidList);
|
|
|
if(dto.getOrderId() ==null){
|
|
|
- MultipartFile videoFile = new MockMultipartFile(tempFile.getName(), new FileInputStream(tempFile));
|
|
|
- VaultsResponse<String> vaultsResponse = ossUtils.uploadOneFile(videoFile,orderId,tempFile,inputStream);
|
|
|
+ VaultsResponse<String> vaultsResponse = ossUtils.uploadOneFile(file,orderId,tempFile,inputStream);
|
|
|
dto.setUrl(vaultsResponse.getData());
|
|
|
}
|
|
|
imageFile.delete();
|