Commit e0d8ac74a47ca78ba16e3715e7e96a778d8846a4

Authored by cherishsince
1 parent fa932811

【优化】处理 mj jdk21降到jdk17语法

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 113  
114 114 //
115 115 // 上传文件
116   - String uploadUrl = uploadAttachmentsRes.getAttachments().getFirst().getUploadUrl();
  116 + String uploadUrl = uploadAttachmentsRes.getAttachments().get(0).getUploadUrl();
117 117 httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA);
118 118 HttpEntity<FileSystemResource> fileSystemResourceHttpEntity = new HttpEntity<>(attachments.getFileSystemResource(), httpHeaders);
119 119 ResponseEntity<String> exchange = restTemplate.exchange(uploadUrl, HttpMethod.PUT, fileSystemResourceHttpEntity, String.class);
... ...