-
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] 본인 프로필 수정 기능 구현 #131
Conversation
Patch이기 때문에 Null check 후 set
avatarId nickname - @NicknameConstraint로 validate intro - @SiZe로 최대 제한 길이 validate
avatarId - 이미 설정된 값인지 체크 nickname - 중복 체크, 이미 설정된 값인지 체크 intro - 이미 설정된 값인지 체크
from validateNickname to checkNicknameIfAlreadyExist
isNicknameAvailable() 메서드에서 구현으로 사용하고 있던 로직 checkNicknameIfAlreadyExist()로 대체
제네릭 이용, null이 아니고 기존 값과 동일하다면 exception throw
isNicknameAvailable(), editProfileStatus() 메서드에서 구현으로 사용하고 있던 로직 checkIfAlreadySetOrThrow()로 대체
: ALREADY_SET_NICKNAME, ALREADY_SET_AVATAR, ALREADY_SET_INTRO
from intro to 소개글
PATCH일 때는 null을 허용하기 때문에 null을 허용하는 NicknameConstraint 정의, null일 때는 valid하다고 판단, null이 아닐 때는 NicknameValidator로 validation을 위임
이미 설정한 닉네임인지 확인 후, 다른 유저가 사용 중인 닉네임인지 확인
src/main/java/org/websoso/WSSServer/validation/NullAllowedNicknameValidator.java
Show resolved
Hide resolved
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.
수고하셨어요!
제네릭을 사용하신 것이 신기하네요~
코멘트 남겼습니다! 확인부탁드려요!
영속성 컨텍스트의 dirty check로 save하지 않아도 db에 반영되므로
from: 조회 후 삭제 to: 조회+삭제 한 번에 수행
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.
굿입니다~~!!
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.
수고하셨습니다! 리뷰 한번만 확인해주세요~
Related Issue
Key Changes
checkIfAlreadySetOrThrow()
)NicknameConstraint
는 null check를 하기 때문에NullAllowedNicknameConstraint
를 정의했습니다.NicknameConstraint
의 validator인NicknameValidator
에 validation을 위임합니다.