| @@ -152,7 +152,6 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| return photoSpeakVideoService.saveOrUpdate(record); | return photoSpeakVideoService.saveOrUpdate(record); | ||||
| } | } | ||||
| @AuthIgnore | |||||
| @ApiOperation("生成视频") | @ApiOperation("生成视频") | ||||
| @PostMapping("createVideo") | @PostMapping("createVideo") | ||||
| public ResultData create(@RequestBody PhotoSpeakVideo record) { | public ResultData create(@RequestBody PhotoSpeakVideo record) { | ||||
| @@ -164,9 +163,9 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| logger.info("TEST--"+ JSONObject.toJSONString(mouldVideo)); | logger.info("TEST--"+ JSONObject.toJSONString(mouldVideo)); | ||||
| // if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据"); | |||||
| // } | |||||
| if(mouldVideo == null || !mouldVideo.getUserId().equals(getMemberId())){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到用户数据"); | |||||
| } | |||||
| if(EnumVideoStatus.ing.getCode().equals(mouldVideo.getVideoStatus()) | if(EnumVideoStatus.ing.getCode().equals(mouldVideo.getVideoStatus()) | ||||
| || EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus()) | || EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus()) | ||||
| @@ -224,18 +224,25 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| param.setUrl(voiceMaterialUrl); | param.setUrl(voiceMaterialUrl); | ||||
| } | } | ||||
| AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | |||||
| if (video.isSuccess()) { | |||||
| photoSpeakVideo.setSaveDir(video.getSaveDir()); | |||||
| photoSpeakVideo.setAudioPath(video.getAudioPath()); | |||||
| photoSpeakVideo.setVideoPath(video.getUrl()); | |||||
| try { | |||||
| AiPhotoSpeakResult video = AiVideoHelper.createPhotoSpeakVideo(param); | |||||
| if (video.isSuccess()) { | |||||
| photoSpeakVideo.setSaveDir(video.getSaveDir()); | |||||
| photoSpeakVideo.setAudioPath(video.getAudioPath()); | |||||
| photoSpeakVideo.setVideoPath(video.getUrl()); | |||||
| this.updateById(photoSpeakVideo); | |||||
| return new ResultData(); | |||||
| } | |||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | |||||
| photoSpeakVideo.setVideoMsg(video.getMsg()); | |||||
| this.updateById(photoSpeakVideo); | this.updateById(photoSpeakVideo); | ||||
| return new ResultData(); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), video.getMsg()); | |||||
| }catch (Exception e){ | |||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | |||||
| photoSpeakVideo.setVideoMsg("Meta接口请求异常"); | |||||
| this.updateById(photoSpeakVideo); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"Meta接口请求异常"); | |||||
| } | } | ||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | |||||
| photoSpeakVideo.setVideoMsg(video.getMsg()); | |||||
| this.updateById(photoSpeakVideo); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), video.getMsg()); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | ||||
| @@ -22,7 +22,7 @@ public class AiPhotoSpeakResult { | |||||
| } else if (code == 3008 && msg.equals("check languages")) { | } else if (code == 3008 && msg.equals("check languages")) { | ||||
| return "(MetaService)文字和语种不对应"; | return "(MetaService)文字和语种不对应"; | ||||
| } else { | } else { | ||||
| return "(MetaService)服务被Avatar攻击... 点击“编辑”重试"; | |||||
| return "(MetaService:" + msg + ")服务被Avatar攻击..."; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -31,10 +31,10 @@ public class AiVideoHelper { | |||||
| // http://nas.pucao.cn:2001/gen_dh_video | // http://nas.pucao.cn:2001/gen_dh_video | ||||
| public static String uri = "http://nas.pucao.cn:2001"; | public static String uri = "http://nas.pucao.cn:2001"; | ||||
| // public static String url = "http://nas.pucao.cn:2002"; | |||||
| public static String url = "http://nas.pucao.cn:2002"; | |||||
| // public static String hy_url = "http://nas.pucao.cn:2002"; | // public static String hy_url = "http://nas.pucao.cn:2002"; | ||||
| public static String url = "http://111.198.0.15:22299"; | |||||
| // public static String url = "http://111.198.0.15:22299"; | |||||
| public static String hy_url = "http://111.198.0.15:22288"; | public static String hy_url = "http://111.198.0.15:22288"; | ||||
| public static String photo_speak_suffix = "/img_talking"; | public static String photo_speak_suffix = "/img_talking"; | ||||