|
|
@@ -2,6 +2,7 @@ package com.iformall.smsdk; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.iformall.sm.AiPreviewResult; |
|
|
|
import com.iformall.sm.AiVideoParam; |
|
|
|
import com.iformall.sm.AiVideoResult; |
|
|
|
import com.iformall.utils.JsonUtil; |
|
|
@@ -44,13 +45,14 @@ public class SmSdkUtils { |
|
|
|
return StringUtils.isNotBlank(data) ? JSON.parseObject(data, AiVideoResult.class) : new AiVideoResult(); |
|
|
|
} |
|
|
|
|
|
|
|
public static Double preview(SmPreviewVideoDTO dto) { |
|
|
|
public static AiPreviewResult preview(SmPreviewVideoDTO dto) { |
|
|
|
String url = smSdkUtils.smSdkProperties.getBaseUrl() + SmSdkConstant.PREVIEW_VIDEO; |
|
|
|
HttpEntity<SmPreviewVideoDTO> httpEntity = new HttpEntity<>(dto); |
|
|
|
log.info("(遂芒api)【预览视频】接口的请求参数:{}", JSON.toJSONString(dto)); |
|
|
|
ResponseEntity<String> response = smSdkUtils.restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class); |
|
|
|
log.info("(遂芒api)【预览视频】接口的响应数据:{}", JSON.toJSONString(response.getBody())); |
|
|
|
JSONObject resultObject = JSON.parseObject(response.getBody()); |
|
|
|
return resultObject.getDouble("data"); |
|
|
|
String data = resultObject.getString("data"); |
|
|
|
return StringUtils.isNotBlank(data) ? JSON.parseObject(data, AiPreviewResult.class) : new AiPreviewResult(); |
|
|
|
} |
|
|
|
} |