Commit e0d8ac74a47ca78ba16e3715e7e96a778d8846a4
1 parent
fa932811
【优化】处理 mj jdk21降到jdk17语法
Showing
1 changed file
with
1 additions
and
1 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/org/springframework/ai/models/midjourney/api/MidjourneyInteractionsApi.java
| @@ -113,7 +113,7 @@ public class MidjourneyInteractionsApi extends MidjourneyInteractions { | @@ -113,7 +113,7 @@ public class MidjourneyInteractionsApi extends MidjourneyInteractions { | ||
| 113 | 113 | ||
| 114 | // | 114 | // |
| 115 | // 上传文件 | 115 | // 上传文件 |
| 116 | - String uploadUrl = uploadAttachmentsRes.getAttachments().getFirst().getUploadUrl(); | 116 | + String uploadUrl = uploadAttachmentsRes.getAttachments().get(0).getUploadUrl(); |
| 117 | httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA); | 117 | httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA); |
| 118 | HttpEntity<FileSystemResource> fileSystemResourceHttpEntity = new HttpEntity<>(attachments.getFileSystemResource(), httpHeaders); | 118 | HttpEntity<FileSystemResource> fileSystemResourceHttpEntity = new HttpEntity<>(attachments.getFileSystemResource(), httpHeaders); |
| 119 | ResponseEntity<String> exchange = restTemplate.exchange(uploadUrl, HttpMethod.PUT, fileSystemResourceHttpEntity, String.class); | 119 | ResponseEntity<String> exchange = restTemplate.exchange(uploadUrl, HttpMethod.PUT, fileSystemResourceHttpEntity, String.class); |