|
@@ -14,9 +14,13 @@ import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.model.utils.CreateObjUtil;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.scene.entity.DownloadTourVideo;
|
|
|
+import com.fdkankan.scene.entity.ScenePlus;
|
|
|
+import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
import com.fdkankan.scene.mapper.IDownloadTourVideoMapper;
|
|
|
import com.fdkankan.scene.oss.OssUtil;
|
|
|
import com.fdkankan.scene.service.IDownloadTourVideoService;
|
|
|
+import com.fdkankan.scene.service.IScenePlusExtService;
|
|
|
+import com.fdkankan.scene.service.IScenePlusService;
|
|
|
import com.fdkankan.scene.util.MergeVideoUtil;
|
|
|
import com.fdkankan.scene.vo.DownloadTourVideoVO;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
@@ -44,6 +48,10 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
|
|
|
private OssUtil ossUtil;
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusExtService scenePlusExtService;
|
|
|
|
|
|
@Override
|
|
|
public DownloadTourVideo getWaitingByNum(String num) {
|
|
@@ -116,6 +124,9 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
|
|
|
|
|
|
String destPath = null;
|
|
|
try {
|
|
|
+ ScenePlus scenePlus = scenePlusService.getById(downloadTourVideo.getNum());
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ String bucket = scenePlusExt.getYunFileBucket();
|
|
|
String destFileName = UUID.randomUUID().toString() + ".mp4";
|
|
|
destPath = ConstantFilePath.SCENE_V4_PATH + downloadTourVideo.getNum() + "/tour/" + destFileName;
|
|
|
File destFile = new File(destPath);
|
|
@@ -126,9 +137,7 @@ public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideo
|
|
|
MergeVideoUtil.ffmpegFormatMp4(srcPath, destPath);
|
|
|
//上传到oss
|
|
|
String ossPath = String.format(UploadFilePath.DOWNLOADS_TOUR_VIDEO, downloadTourVideo.getNum()) + downloadTourVideo.getFileName();
|
|
|
- Map<String, String> headers = new HashMap<>();
|
|
|
- headers.put(HttpHeaders.CONTENT_TYPE, "application/octet-stream");
|
|
|
-// ossUtil.uploadFile(ossPath, destPath, false);
|
|
|
+ ossUtil.uploadFile(bucket, ossPath, destPath, false);
|
|
|
downloadTourVideo.setDownloadPath(ossPath);
|
|
|
downloadTourVideo.setState(1);
|
|
|
this.updateById(downloadTourVideo);
|