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;
}
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")


+ 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){
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();


+ 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
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();



Loading…
Cancel
Save