|
|
@@ -363,4 +363,47 @@ public class PhotoSpeakVideoController extends BaseController { |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("视频超分") |
|
|
|
@GetMapping("/videoHy") |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData videoHy(Long id) { |
|
|
|
logger.debug("[" + getIpAddr() + "] PersonPhotoController::videoHy"); |
|
|
|
if(id == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"参数为空"); |
|
|
|
} |
|
|
|
PhotoSpeakVideo speakVideo = photoSpeakVideoService.getById(id); |
|
|
|
if(speakVideo == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到数据"); |
|
|
|
} |
|
|
|
if (StringUtils.isEmpty(speakVideo.getSaveDir())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"save_dir为空"); |
|
|
|
} |
|
|
|
if(!speakVideo.getUserId().equals(getMemberId())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到用户数据"); |
|
|
|
} |
|
|
|
|
|
|
|
if(!EnumVideoStatus.upload_success.getCode().equals(speakVideo.getVideoStatus())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"原始视频生成未完成"); |
|
|
|
} |
|
|
|
|
|
|
|
if(EnumVideoStatus.ing.getCode().equals(speakVideo.getVideoHyStatus()) |
|
|
|
|| EnumVideoStatus.success.getCode().equals(speakVideo.getVideoHyStatus()) |
|
|
|
|| EnumVideoStatus.upload_ing.getCode().equals(speakVideo.getVideoHyStatus()) |
|
|
|
|| EnumVideoStatus.upload_fail.getCode().equals(speakVideo.getVideoHyStatus())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频生成中"); |
|
|
|
} |
|
|
|
if(EnumVideoStatus.upload_success.getCode().equals(speakVideo.getVideoHyStatus())){ |
|
|
|
//上传阿里云状态 生成成功 |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"高清晰度视频已生成完成"); |
|
|
|
} |
|
|
|
|
|
|
|
speakVideo.setVideoStatus(EnumVideoStatus.ing.getCode()); |
|
|
|
speakVideo.setVideoMsg(""); |
|
|
|
speakVideo.setUpdateDate(new Date()); |
|
|
|
photoSpeakVideoService.updateById(speakVideo); |
|
|
|
|
|
|
|
photoSpeakVideoService.videoHy(speakVideo,true); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
} |