Skip to content

Commit

Permalink
Merge pull request #44 from InjeRecipe/#12-amazon-s3
Browse files Browse the repository at this point in the history
fix: keyword당 하나씩 이미지 반환
  • Loading branch information
Gdm0714 committed Mar 27, 2024
2 parents a0b2310 + 28af818 commit b9a8f22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String uploadImage(MultipartFile image, String fileName) throws IOExcepti
}
}

public List<String> getImageUrlsWithKeyword(String keyword) {
public String getImageUrlsWithKeyword(String keyword) {
List<String> imageUrls = new ArrayList<>();

ListObjectsV2Request request = new ListObjectsV2Request()
Expand All @@ -61,8 +61,8 @@ public List<String> getImageUrlsWithKeyword(String keyword) {
}
request.setContinuationToken(result.getNextContinuationToken());
} while (result.isTruncated());

return imageUrls;
String imageUrl = imageUrls.get(0);
return imageUrl;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public ImageUploadResponse registerImage(ImageUploadRequest request)throws IOExc
return ImageUploadResponse.from(request.getName(), imageUrl);
}

public List<List<String>> searchImage(ImageSearchRequest request){
public List<String> searchImage(ImageSearchRequest request){
List<String> nameList = request.getName();
List<List<String>> url = new ArrayList<>();
List<String> url = new ArrayList<>();
for(String name: nameList) {
url.add(amazonS3Service.getImageUrlsWithKeyword(name));
}
Expand Down

0 comments on commit b9a8f22

Please sign in to comment.