|
@@ -24,6 +24,7 @@ import com.fdkankan.scene.bean.SceneJsonBean;
|
|
import com.fdkankan.scene.entity.SceneEditControls;
|
|
import com.fdkankan.scene.entity.SceneEditControls;
|
|
import com.fdkankan.scene.entity.SceneEditInfo;
|
|
import com.fdkankan.scene.entity.SceneEditInfo;
|
|
import com.fdkankan.scene.entity.ScenePro;
|
|
import com.fdkankan.scene.entity.ScenePro;
|
|
|
|
+import com.fdkankan.scene.entity.SceneProExt;
|
|
import com.fdkankan.scene.factory.FloorLogoHandlerFactory;
|
|
import com.fdkankan.scene.factory.FloorLogoHandlerFactory;
|
|
import com.fdkankan.scene.factory.MusicHandlerFactory;
|
|
import com.fdkankan.scene.factory.MusicHandlerFactory;
|
|
import com.fdkankan.scene.factory.ScreenshotHandlerFactory;
|
|
import com.fdkankan.scene.factory.ScreenshotHandlerFactory;
|
|
@@ -639,6 +640,52 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public DownloadVO downloadBallScreenVideo(BallScreenVideoParamVO param) {
|
|
|
|
+ String videoPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + param.getPlanId() + ".mp4";
|
|
|
|
+ String url = ossUrlPrefix + videoPath + "?t=" + System.currentTimeMillis();
|
|
|
|
+ return DownloadVO.builder()
|
|
|
|
+ .fileName(param.getFileName())
|
|
|
|
+ .url(url)
|
|
|
|
+ .build();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ResultData uploadBallScreenVideo(String num, String fileName, MultipartFile file)
|
|
|
|
+ throws IOException {
|
|
|
|
+
|
|
|
|
+ if(!fileName.endsWith(".mp4")){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7007.code(), ErrorCode.FAILURE_CODE_7007.formatMessage("mp4"));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
|
+ if(scenePro == null){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
+ }
|
|
|
|
+ SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
|
|
+
|
|
|
|
+ String path = sceneProExt.getDataSource();
|
|
|
|
+
|
|
|
|
+ if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
|
|
+ path = ConstantFilePath.BUILD_MODEL_PATH + File.separator + path.split("/")[path.split("/").length - 2];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String target = path + "_images";
|
|
|
|
+
|
|
|
|
+ String filePath = target + File.separator + "extras/video" + File.separator + fileName;
|
|
|
|
+
|
|
|
|
+ File targetFile = new File(filePath);
|
|
|
|
+ if(!targetFile.getParentFile().exists()){
|
|
|
|
+ targetFile.getParentFile().mkdirs();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //上传文件
|
|
|
|
+ file.transferTo(targetFile);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
private void updateBoxVideos(SceneEditInfo sceneEditInfo, Long sceneProId, String boxVideos){
|
|
private void updateBoxVideos(SceneEditInfo sceneEditInfo, Long sceneProId, String boxVideos){
|
|
if(StrUtil.isEmpty(boxVideos)){
|
|
if(StrUtil.isEmpty(boxVideos)){
|
|
return;
|
|
return;
|