|
|
@@ -346,18 +346,26 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
param.setAudio_path(speakVideo.getAudioPath()); |
|
|
|
param.setTask_id(speakVideo.getId()); |
|
|
|
param.setCallback_url(callbackUrl + "/callback/photo/speak"); |
|
|
|
AiVideoHqResult result = AiVideoHelper.videoHq(param); |
|
|
|
if (result.isSuccess()) { |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); |
|
|
|
speakVideo.setVideoMsg("超分视频生成成功"); |
|
|
|
speakVideo.setVideoPath(result.getUrl()); |
|
|
|
try { |
|
|
|
AiVideoHqResult result = AiVideoHelper.videoHq(param); |
|
|
|
if (result.isSuccess()) { |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.success.getCode()); |
|
|
|
speakVideo.setVideoMsg("超分视频生成成功"); |
|
|
|
speakVideo.setVideoPath(result.getUrl()); |
|
|
|
this.updateById(speakVideo); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); |
|
|
|
speakVideo.setVideoMsg("Mata视频超分失败"); |
|
|
|
this.updateById(speakVideo); |
|
|
|
return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); |
|
|
|
speakVideo.setVideoMsg("Mata视频超分失败"); |
|
|
|
this.updateById(speakVideo); |
|
|
|
return new ResultData(); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); |
|
|
|
} |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); |
|
|
|
speakVideo.setVideoMsg("视频超分失败"); |
|
|
|
this.updateById(speakVideo); |
|
|
|
return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); |
|
|
@@ -437,12 +445,15 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData checkVideoStatus(Long userId, List<Long> list) { |
|
|
|
public ResultData checkVideoStatus(Long userId, List<Long> list, Integer type) { |
|
|
|
if (CollectionUtils.isEmpty(list)){ |
|
|
|
return new ResultData(ErrorCode.VIDEO_CREATING.getCode(),""); |
|
|
|
} |
|
|
|
|
|
|
|
Integer integer = photoSpeakVideoMapper.checkVideoStatus(userId,list); |
|
|
|
if (type == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"类型不能为空"); |
|
|
|
} |
|
|
|
Integer integer = photoSpeakVideoMapper.checkVideoStatus(userId,list,type); |
|
|
|
if (integer > 0){ |
|
|
|
return new ResultData("生成视频成功"); |
|
|
|
} |
|
|
|