|
@@ -192,6 +192,8 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
@Override |
|
|
@Override |
|
|
@Async |
|
|
@Async |
|
|
public ResultData createVideo(PhotoSpeakVideo photoSpeakVideo) { |
|
|
public ResultData createVideo(PhotoSpeakVideo photoSpeakVideo) { |
|
|
|
|
|
PhotoSpeakVideo speakVideoUpd = new PhotoSpeakVideo(); |
|
|
|
|
|
speakVideoUpd.setId(photoSpeakVideo.getId()); |
|
|
try { |
|
|
try { |
|
|
AiPhotoSpeakParam param = new AiPhotoSpeakParam(); |
|
|
AiPhotoSpeakParam param = new AiPhotoSpeakParam(); |
|
|
param.setTask_id(photoSpeakVideo.getId()); |
|
|
param.setTask_id(photoSpeakVideo.getId()); |
|
@@ -235,27 +237,27 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
try { |
|
|
try { |
|
|
AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); |
|
|
AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); |
|
|
if (video.isSuccess()) { |
|
|
if (video.isSuccess()) { |
|
|
// photoSpeakVideo.setSaveDir(video.getSaveDir()); |
|
|
|
|
|
// photoSpeakVideo.setAudioPath(video.getAudioPath()); |
|
|
|
|
|
// photoSpeakVideo.setVideoPath(video.getUrl()); |
|
|
|
|
|
// this.updateById(photoSpeakVideo); |
|
|
|
|
|
|
|
|
// speakVideoUpd.setSaveDir(video.getSaveDir()); |
|
|
|
|
|
// speakVideoUpd.setAudioPath(video.getAudioPath()); |
|
|
|
|
|
// speakVideoUpd.setVideoPath(video.getUrl()); |
|
|
|
|
|
// this.updateById(speakVideoUpd); |
|
|
return new ResultData(); |
|
|
return new ResultData(); |
|
|
} |
|
|
} |
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
|
|
photoSpeakVideo.setVideoMsg(video.getMsg()); |
|
|
|
|
|
this.updateById(photoSpeakVideo); |
|
|
|
|
|
|
|
|
speakVideoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
|
|
speakVideoUpd.setVideoMsg(video.getMsg()); |
|
|
|
|
|
this.updateById(speakVideoUpd); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), video.getMsg()); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), video.getMsg()); |
|
|
}catch (Exception e){ |
|
|
}catch (Exception e){ |
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
|
|
photoSpeakVideo.setVideoMsg("Meta接口请求异常"); |
|
|
|
|
|
this.updateById(photoSpeakVideo); |
|
|
|
|
|
|
|
|
speakVideoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
|
|
speakVideoUpd.setVideoMsg("Meta接口请求异常"); |
|
|
|
|
|
this.updateById(speakVideoUpd); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
|
|
photoSpeakVideo.setVideoMsg("接口请求异常"); |
|
|
|
|
|
this.updateById(photoSpeakVideo); |
|
|
|
|
|
|
|
|
speakVideoUpd.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
|
|
speakVideoUpd.setVideoMsg("接口请求异常"); |
|
|
|
|
|
this.updateById(speakVideoUpd); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"生成视频失败"); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"生成视频失败"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -348,6 +350,8 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
@Override |
|
|
@Override |
|
|
@Async |
|
|
@Async |
|
|
public ResultData videoHy(PhotoSpeakVideo speakVideo) { |
|
|
public ResultData videoHy(PhotoSpeakVideo speakVideo) { |
|
|
|
|
|
PhotoSpeakVideo speakVideoUpd = new PhotoSpeakVideo(); |
|
|
|
|
|
speakVideoUpd.setId(speakVideo.getId()); |
|
|
try { |
|
|
try { |
|
|
AiVideoHqParam param = new AiVideoHqParam(); |
|
|
AiVideoHqParam param = new AiVideoHqParam(); |
|
|
param.setSave_dir(speakVideo.getSaveDir()); |
|
|
param.setSave_dir(speakVideo.getSaveDir()); |
|
@@ -357,31 +361,31 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
try { |
|
|
try { |
|
|
AiVideoHqResult result = AiVideoHelper.videoHq(param); |
|
|
AiVideoHqResult result = AiVideoHelper.videoHq(param); |
|
|
if (result.isSuccess()) { |
|
|
if (result.isSuccess()) { |
|
|
// speakVideo.setVideoStatus(EnumVideoStatus.hy_success.getCode()); |
|
|
|
|
|
// speakVideo.setVideoMsg("超分视频生成成功"); |
|
|
|
|
|
// speakVideo.setVideoPath(result.getUrl()); |
|
|
|
|
|
// this.updateById(speakVideo); |
|
|
|
|
|
|
|
|
// speakVideoUpd.setVideoStatus(EnumVideoStatus.hy_success.getCode()); |
|
|
|
|
|
// speakVideoUpd.setVideoMsg("超分视频生成成功"); |
|
|
|
|
|
// speakVideoUpd.setVideoPath(result.getUrl()); |
|
|
|
|
|
// this.updateById(speakVideoUpd); |
|
|
return new ResultData(); |
|
|
return new ResultData(); |
|
|
} |
|
|
} |
|
|
speakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); |
|
|
|
|
|
speakVideo.setVideoMsg("Mata视频超分失败"); |
|
|
|
|
|
speakVideo.setIsHy(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
this.updateById(speakVideo); |
|
|
|
|
|
|
|
|
speakVideoUpd.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); |
|
|
|
|
|
speakVideoUpd.setVideoMsg("Mata视频超分失败"); |
|
|
|
|
|
speakVideoUpd.setIsHy(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
this.updateById(speakVideoUpd); |
|
|
return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); |
|
|
return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); |
|
|
}catch (Exception e){ |
|
|
}catch (Exception e){ |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
speakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); |
|
|
|
|
|
speakVideo.setVideoMsg("Mata视频超分失败"); |
|
|
|
|
|
speakVideo.setIsHy(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
this.updateById(speakVideo); |
|
|
|
|
|
|
|
|
speakVideoUpd.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); |
|
|
|
|
|
speakVideoUpd.setVideoMsg("Mata视频超分失败"); |
|
|
|
|
|
speakVideoUpd.setIsHy(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
this.updateById(speakVideoUpd); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
speakVideo.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); |
|
|
|
|
|
speakVideo.setVideoMsg("超分视频接口请求异常"); |
|
|
|
|
|
speakVideo.setIsHy(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
this.updateById(speakVideo); |
|
|
|
|
|
|
|
|
speakVideoUpd.setVideoStatus(EnumVideoStatus.hy_fail.getCode()); |
|
|
|
|
|
speakVideoUpd.setVideoMsg("超分视频接口请求异常"); |
|
|
|
|
|
speakVideoUpd.setIsHy(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
this.updateById(speakVideoUpd); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "超分视频接口请求异常"); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "超分视频接口请求异常"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|