Skip to content

Commit

Permalink
hotfix(BE): 유저 프로필 사진 불러오기 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
namhyo01 committed Nov 22, 2023
1 parent da0812c commit 116661f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,19 @@ public ResponseEntity<InputStreamResource> getProfileImage() {
.body(new InputStreamResource(fileStream));
}

@Operation(summary = "Get user profile image", description = "사용자의 프로필 이미지를 불러온다.")
@GetMapping("/user/image/{userId}")
public ResponseEntity<InputStreamResource> 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 (데이터)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/example/api/user/dto/FindUserDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import lombok.*;

import java.time.LocalDateTime;
import java.util.UUID;

@Getter
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class FindUserDto {
private UUID userId;
@NotBlank
private String username;

Expand Down

0 comments on commit 116661f

Please sign in to comment.