From 18aaaecc3595dd7b825200ecae919251c8e33ca6 Mon Sep 17 00:00:00 2001 From: lrh <1585126058@qq.com> Date: Mon, 5 Jun 2023 14:12:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/po/sm/PhotoSpeakVideo.java | 6 ++++++ .../service/sm/impl/PhotoSpeakVideoServiceImpl.java | 2 +- .../src/main/java/com/iformall/sm/AiVideoHelper.java | 10 ++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) 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();