diff --git a/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java b/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java index 2fd59c5..235ca98 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/PhotoSpeakVideoController.java @@ -152,7 +152,6 @@ public class PhotoSpeakVideoController extends BaseController { return photoSpeakVideoService.saveOrUpdate(record); } - @AuthIgnore @ApiOperation("生成视频") @PostMapping("createVideo") public ResultData create(@RequestBody PhotoSpeakVideo record) { @@ -164,9 +163,9 @@ public class PhotoSpeakVideoController extends BaseController { 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()) || EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus()) diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java index 8eaa771..0479ed8 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java @@ -224,18 +224,25 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { 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); - 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) { e.printStackTrace(); photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); diff --git a/suimangService/src/main/java/com/iformall/sm/AiPhotoSpeakResult.java b/suimangService/src/main/java/com/iformall/sm/AiPhotoSpeakResult.java index dc50d4a..8612048 100644 --- a/suimangService/src/main/java/com/iformall/sm/AiPhotoSpeakResult.java +++ b/suimangService/src/main/java/com/iformall/sm/AiPhotoSpeakResult.java @@ -22,7 +22,7 @@ public class AiPhotoSpeakResult { } else if (code == 3008 && msg.equals("check languages")) { return "(MetaService)文字和语种不对应"; } else { - return "(MetaService)服务被Avatar攻击... 点击“编辑”重试"; + return "(MetaService:" + msg + ")服务被Avatar攻击..."; } } } diff --git a/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java b/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java index f825a3b..fcbc895 100644 --- a/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java +++ b/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java @@ -31,10 +31,10 @@ public class AiVideoHelper { // http://nas.pucao.cn:2001/gen_dh_video 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 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 photo_speak_suffix = "/img_talking";