Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/339 기관 프로필 이미지 업데이트 리팩토링 #348

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

7zrv
Copy link
Collaborator

@7zrv 7zrv commented Feb 3, 2025

📌 과제 설명

이미지 업로드 방식이 presigned 방식으로 변경됨에 따라
기관 프로필 이미지 업데이트 api를 리팩토링했습니다.
프론트에서의 에러가 우려되어 기존 이용하던 기능은 그대로 두었습니다.

👩‍💻 요구 사항과 구현 내용

  • 유저 공통속성 엔티티에 imgUrl 상태 변경 메서드 추가
  • 유저 공통속성의 프로필 이미지 url 변경 유스케이스 생성
  • 기관 도메인에 프로필 이미지 업데이트 유스케이스 구현
  • 기관 프로필 이미지 업데이트 엔드포인트 추가

✅ PR 포인트 & 궁금한 점

7zrv added 5 commits February 3, 2025 22:55
- userId 직렬화 어노테이션 변경
- 테스트및 검증 완료
- 프로필 이미지 url 필드를 변경하는 메서드 구현
- 테스트및 검증 완료
- 프로필 이미지 업데이트 유스케이스및 구현체 구현
- 요청 레코드 생성
- 테스트및 검증 완료
- 프로필 이미지 업데이트 유스케이스및 구현체 구현
- 요청 레코드 생성
- 테스트및 검증 완료
- 프로필 이미지 업데이트 엔드 포인트 구현
- 테스트및 검증 완료
@7zrv 7zrv self-assigned this Feb 3, 2025
@7zrv 7zrv linked an issue Feb 3, 2025 that may be closed by this pull request
2 tasks
@7zrv 7zrv requested review from leebs0521, m-a-king and ayoung-dev and removed request for leebs0521 and m-a-king February 3, 2025 14:01
@7zrv 7zrv requested a review from m-a-king February 3, 2025 14:02
Copy link
Collaborator

@m-a-king m-a-king left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다


String presignedUrl = imageUploadUseCase.getPresignedUrl(requestDto.fileName());

String fileUrl = presignedUrl.split("\\?")[0];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presignedUrl을 클래스로 만들고, 스플릿 메서드를 메서드로 나타내도 좋을 것 같습니다

Copy link
Collaborator

@leebs0521 leebs0521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다.

이미지 업로드 로직을 프론트분들에게 말씀드려야 작업하실것 같습니다.

@Secured("ROLE_CENTER")
@Operation(summary = "기관 프로필 이미지 수정", description = "기관의 프로필 이미지를 수정합니다.")
@PutMapping("/profileImgUpdate")
public ApiResponse<String> updateCenterProfile(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

카멜케이스보다 /profile-image 이나 /profile/image 정도로 바꾸는게 좋아보입니다.

@@ -34,9 +34,9 @@ public class PreferItemCommandApiController {
@PostMapping()
public ApiResponse<PreferItemCreateResponseDto> registerPreferItem(
@Valid @RequestBody PreferItemCreateRequestDto requestDto,
@CurrentUser UUID userId) {
@UserId UUID centerId) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoleId 이어야할것 같은데 맞나요

public record UpdateProfileImgUrlRequestDto(
UUID userId,
String profileImgUrl
) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema 추가하면 좋을것 같습니다.

Copy link
Collaborator

@m-a-king m-a-king left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가했습니당

Comment on lines +5 to +7
public record CenterProfileImgUpdateRequestDto(
@Schema(description = "파일 이름", example = "image.png")
String fileName
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. 이 포함되어야하는 검증이 추가돼도 될 것 같습니다

@7zrv 7zrv merged commit b5e2b77 into main Feb 5, 2025
3 checks passed
@7zrv 7zrv deleted the refactor/339-modify-center-preferitem-api branch February 5, 2025 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] 테이블 재설계에 따른 기관 관련 API 리팩토링
3 participants