|
|
@@ -36,9 +36,9 @@ public class SmSdkUtils { |
|
|
|
|
|
|
|
public static AiPreviewResult preview(SmPreviewVideoDTO dto) { |
|
|
|
String url = smSdkUtils.smSdkProperties.getBaseUrl() + SmSdkConstant.PREVIEW_VIDEO; |
|
|
|
HttpEntity<SmPreviewVideoDTO> httpEntity = new HttpEntity<>(dto); |
|
|
|
// HttpEntity<SmPreviewVideoDTO> httpEntity = new HttpEntity<>(dto); |
|
|
|
log.info("(遂芒api)【预览视频】接口的请求参数:{}", JSON.toJSONString(dto)); |
|
|
|
ResponseEntity<String> response = smSdkUtils.restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class); |
|
|
|
ResponseEntity<String> response = smSdkUtils.restTemplate.exchange(url, HttpMethod.POST, SmUtils.getHttpEntity(JSON.toJSONString(dto)), String.class); |
|
|
|
log.info("(遂芒api)【预览视频】接口的响应数据:{}", JSON.toJSONString(response.getBody())); |
|
|
|
JSONObject resultObject = JSON.parseObject(response.getBody()); |
|
|
|
String data = resultObject.getString("data"); |
|
|
@@ -47,9 +47,9 @@ public class SmSdkUtils { |
|
|
|
|
|
|
|
public static AiVideoResult generateVideo(SmGenerateVideoDTO dto) { |
|
|
|
String url = smSdkUtils.smSdkProperties.getBaseUrl() + SmSdkConstant.GENERATE_VIDEO; |
|
|
|
HttpEntity<SmGenerateVideoDTO> httpEntity = new HttpEntity<>(dto); |
|
|
|
// HttpEntity<SmGenerateVideoDTO> httpEntity = new HttpEntity<>(dto); |
|
|
|
log.info("(遂芒api)【生成视频】接口的请求参数:{}", JSON.toJSONString(dto)); |
|
|
|
ResponseEntity<String> response = smSdkUtils.restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class); |
|
|
|
ResponseEntity<String> response = smSdkUtils.restTemplate.exchange(url, HttpMethod.POST, SmUtils.getHttpEntity(JSON.toJSONString(dto)), String.class); |
|
|
|
log.info("(遂芒api)【生成视频】接口的响应数据:{}", JSON.toJSONString(response.getBody())); |
|
|
|
JSONObject resultObject = JSON.parseObject(response.getBody()); |
|
|
|
String data = resultObject.getString("data"); |
|
|
|