Browse Source

修改生成视频接口

private_deployment
lrh 1 year ago
parent
commit
18aaaecc35
3 changed files with 13 additions and 5 deletions
  1. +6
    -0
      suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java
  2. +1
    -1
      suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java
  3. +6
    -4
      suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java

+ 6
- 0
suimangService/src/main/java/com/iformall/domain/po/sm/PhotoSpeakVideo.java View File

@@ -108,6 +108,12 @@ public class PhotoSpeakVideo extends TenantEntity {
} }
return videoPathUri; return videoPathUri;
} }
public String getPhotoSpeakPathUri(){
if(StringUtils.isNotBlank(this.videoPath)){
videoPathUri = AiVideoHelper.url;
}
return videoPathUri;
}
@io.swagger.annotations.ApiModelProperty(value="",name="videoPath") @io.swagger.annotations.ApiModelProperty(value="",name="videoPath")
private String videoPath; private String videoPath;
@io.swagger.annotations.ApiModelProperty(value="播放地址",name="videoPlayUrl") @io.swagger.annotations.ApiModelProperty(value="播放地址",name="videoPlayUrl")


+ 1
- 1
suimangService/src/main/java/com/iformall/service/sm/impl/PhotoSpeakVideoServiceImpl.java View File

@@ -279,7 +279,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService {
public void uploadVideo(PhotoSpeakVideo mouldVideo){ public void uploadVideo(PhotoSpeakVideo mouldVideo){
if(EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus()) if(EnumVideoStatus.success.getCode().equals(mouldVideo.getVideoStatus())
|| EnumVideoStatus.upload_fail.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); VideUploadResult result = videoFactory.getExcutor(videoType).uploadVideoPath(mouldVideo.getTitle(), url);
if(result.isSuccess()){ if(result.isSuccess()){
PhotoSpeakVideo videoUpd = new PhotoSpeakVideo(); PhotoSpeakVideo videoUpd = new PhotoSpeakVideo();


+ 6
- 4
suimangService/src/main/java/com/iformall/sm/AiVideoHelper.java View File

@@ -31,8 +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/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) { public static String doPost(String url, String params) {
return HttpUtil.doAiVideoPost(url,params); return HttpUtil.doAiVideoPost(url,params);
} }
@@ -99,7 +101,7 @@ public class AiVideoHelper {
} }
public static AiPhotoSpeakResult createPhotoSpeakVideo(AiPhotoSpeakParam videoParam) { public static AiPhotoSpeakResult createPhotoSpeakVideo(AiPhotoSpeakParam videoParam) {
log.info("生成视频start request:" + videoParam.neglectImgString()); 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); log.info("生成视频end response:" + response);
AiPhotoSpeakResult result = new AiPhotoSpeakResult(); AiPhotoSpeakResult result = new AiPhotoSpeakResult();
if (StringUtils.isBlank(response)) { if (StringUtils.isBlank(response)) {
@@ -133,7 +135,7 @@ public class AiVideoHelper {


public static AiCheckPhotoResult checkPhoto(String str) { public static AiCheckPhotoResult checkPhoto(String str) {
log.info("生成视频start request:" + 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); log.info("生成视频end response:" + response);
AiCheckPhotoResult result = new AiCheckPhotoResult(); AiCheckPhotoResult result = new AiCheckPhotoResult();




Loading…
Cancel
Save