diff --git a/src/main/java/com/example/api/user/adapter/in/rest/UserController.java b/src/main/java/com/example/api/user/adapter/in/rest/UserController.java index b8be059..cbd109d 100644 --- a/src/main/java/com/example/api/user/adapter/in/rest/UserController.java +++ b/src/main/java/com/example/api/user/adapter/in/rest/UserController.java @@ -230,6 +230,19 @@ public ResponseEntity getProfileImage() { .body(new InputStreamResource(fileStream)); } + @Operation(summary = "Get user profile image", description = "사용자의 프로필 이미지를 불러온다.") + @GetMapping("/user/image/{userId}") + public ResponseEntity getProfileUserImage(@PathVariable UUID userId) { + String filename = profileImageUsecase.getProfileImageName(userId); + if (filename == null) { + return null; + } + InputStream fileStream = fileDisplayUsecase.display(filename); + return ResponseEntity.ok() + .contentType(MediaType.IMAGE_PNG) + .body(new InputStreamResource(fileStream)); + } + /** * 현재 로그인한 사용자 정보 수정 * @param userDto (데이터) diff --git a/src/main/java/com/example/api/user/dto/FindUserDto.java b/src/main/java/com/example/api/user/dto/FindUserDto.java index e76e4e3..bbf74ee 100644 --- a/src/main/java/com/example/api/user/dto/FindUserDto.java +++ b/src/main/java/com/example/api/user/dto/FindUserDto.java @@ -6,6 +6,7 @@ import lombok.*; import java.time.LocalDateTime; +import java.util.UUID; @Getter @Builder @@ -13,6 +14,7 @@ @NoArgsConstructor @AllArgsConstructor public class FindUserDto { + private UUID userId; @NotBlank private String username;