diff --git a/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java b/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java index defe03f..2654e98 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java +++ b/suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java @@ -108,6 +108,12 @@ public class PhotoSpeakVideo extends TenantEntity { } return videoPathUri; } + public String getPhotoSpeakPathUri(){ + if(StringUtils.isNotBlank(this.videoPath)){ + videoPathUri = AiVideoHelper.url; + } + return videoPathUri; + } @io.swagger.annotations.ApiModelProperty(value="",name="videoPath") private String videoPath; @io.swagger.annotations.ApiModelProperty(value="播放地址",name="videoPlayUrl") 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 19595ae..edae75a 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 @@ -279,7 +279,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { public void uploadVideo(PhotoSpeakVideo mouldVideo){ if(EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus()) || EnumVideoStatus.upload_fail.getCode().equals(mouldVideo.getVideoStatus())){ - String url = mouldVideo.getVideoPathUri() + mouldVideo.getVideoPath(); + String url = mouldVideo.getPhotoSpeakPathUri() + mouldVideo.getVideoPath(); VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoPath(mouldVideo.getTitle(), url); if(result.isSuccess()){ PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); diff --git a/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java b/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java index a3eed3c..78f7fdd 100644 --- a/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java +++ b/suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java @@ -31,8 +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/img_talking"; - public static String url1 = "http://nas.pucao.cn:2002/image_qualit"; + public static String url = "http://nas.pucao.cn:2002"; + public static String photo_speak_suffix = "/img_talking"; + public static String image_quality_suffix = "/img_talking"; + public static String doPost(String url, String params) { return HttpUtil.doAiVideoPost(url,params); } @@ -99,7 +101,7 @@ public class AiVideoHelper { } public static AiPhotoSpeakResult createPhotoSpeakVideo(AiPhotoSpeakParam videoParam) { log.info("生成视频start request:" + videoParam.neglectImgString()); - String response = doPost(url, JSONObject.toJSONString(videoParam)); + String response = doPost(url + photo_speak_suffix, JSONObject.toJSONString(videoParam)); log.info("生成视频end response:" + response); AiPhotoSpeakResult result = new AiPhotoSpeakResult(); if (StringUtils.isBlank(response)) { @@ -133,7 +135,7 @@ public class AiVideoHelper { public static AiCheckPhotoResult checkPhoto(String str) { log.info("生成视频start request:" + str); - String response = doPost(url1, JSONObject.toJSONString(str)); + String response = doPost(url + image_quality_suffix, JSONObject.toJSONString(str)); log.info("生成视频end response:" + response); AiCheckPhotoResult result = new AiCheckPhotoResult();