-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/#30 유저 프로필 수정 기능 구현 #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다.!
@@ -4,5 +4,15 @@ public enum Keyword { | |||
COOK, | |||
GAME, | |||
EXERCISE, | |||
; | |||
|
|||
public static boolean isValidKeyword(String keyword) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum에서 제공하는 Keyword.valueOf()
메서드 사용하는게 더 좋아보여요!
} | ||
} | ||
|
||
private void validateInterests(List<Keyword> interests) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
서비스 레이어에서 말고,
DTO 객체에서 입력값에 대한 검증 로직을 추가하는게 좋아보입니다!
import jakarta.validation.constraints.NotBlank; | ||
import java.util.List; | ||
|
||
public record UpdateProfileRequest(@NotBlank String nickname, List<Keyword> interests) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
바로 이곳!
if (nickname != null) { | ||
user.getProfile().updateNickname(nickname); | ||
} | ||
if (interests != null && !interests.isEmpty()) { | ||
interestService.updateInterests(userId, interests); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
입력 값에 대한 검증 로직은 dto에 추가해 주세요
@@ -29,4 +34,18 @@ public ResponseEntity<MyProfileResponse> findMyProfile(@Login AuthInfo authInfo) | |||
return ResponseEntity.ok(userService.findMyProfile(authInfo.userId())); | |||
} | |||
|
|||
@PatchMapping("/me/profile-image") | |||
public ResponseEntity<Void> updateProfileImage(@Login AuthInfo authInfo, | |||
@RequestParam String profileImageUrl) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dto 객체로 빼서 검증 해주세용
이슈번호
close: #30
작업 내용 설명
리뷰어에게 한마디