|
|
@@ -188,16 +188,18 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
param.setTask_id(photoSpeakVideo.getId()); |
|
|
|
param.setCallback_url(callbackUrl + "/callback/photo/speak"); |
|
|
|
param.setImg(Base64Util.imageUrlToBase64(photoSpeakVideo.getPersonPhotoUrl())); |
|
|
|
param.setVoice_id(photoSpeakVideo.getVoiceMouldSm() == null ? "default" : photoSpeakVideo.getVoiceMouldSm()); |
|
|
|
String voiceMouldSm = photoSpeakVideo.getVoiceMouldSm(); |
|
|
|
Integer sex = 1; |
|
|
|
String speakType = null; |
|
|
|
Integer speakType = 0; |
|
|
|
String mouldSmId = null; |
|
|
|
if (!StringUtils.isBlank(voiceMouldSm)) { |
|
|
|
JSONObject jsonObject = JSON.parseObject(voiceMouldSm); |
|
|
|
speakType = jsonObject.getString("speakType"); |
|
|
|
speakType = jsonObject.getInteger("speakType"); |
|
|
|
sex = jsonObject.getInteger("sex"); |
|
|
|
mouldSmId = jsonObject.getString("mouldSmId"); |
|
|
|
} |
|
|
|
param.setVoice_style(speakType == null ? "default" : EnumSpeakType.getEnum(speakType).getType()); |
|
|
|
param.setVoice_id(mouldSmId == null ? "default" : mouldSmId); |
|
|
|
|
|
|
|
Integer voiceFrom = photoSpeakVideo.getVoiceFrom(); |
|
|
|
String voiceMaterialUrl = photoSpeakVideo.getVoiceMaterialUrl(); |
|
|
@@ -228,16 +230,16 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
this.updateById(photoSpeakVideo); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.draft.getCode()); |
|
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
photoSpeakVideo.setVideoMsg(video.getMsg()); |
|
|
|
this.updateById(photoSpeakVideo); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"接口请求异常"); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"生成视频失败"); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.draft.getCode()); |
|
|
|
photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); |
|
|
|
photoSpeakVideo.setVideoMsg("接口请求异常"); |
|
|
|
this.updateById(photoSpeakVideo); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"接口请求异常"); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"生成视频失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -381,8 +383,8 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData checkVideoStatus(Long userId) { |
|
|
|
Integer integer = photoSpeakVideoMapper.checkVideoStatus(userId); |
|
|
|
public ResultData checkVideoStatus(Long userId, String time) { |
|
|
|
Integer integer = photoSpeakVideoMapper.checkVideoStatus(userId,time); |
|
|
|
if (integer > 0){ |
|
|
|
return new ResultData("生成视频成功"); |
|
|
|
} |
|
|
|