-
Notifications
You must be signed in to change notification settings - Fork 4
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
성별, 나이 수정 기능 구현 #339
Merged
성별, 나이 수정 기능 구현 #339
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8714943
feat: (#338) 회원 정보 수정 기능 구현
jeomxon b002502
test: (#338) 회원 정보 수정 기능에 대한 검증 추가
jeomxon 531676e
refactor: (#338) DDL 수정
jeomxon 87e7a15
refactor: (#338) request valid 수정
jeomxon 73f1476
refactor: (#338) ddl변경에 따른 테스트 에러 수정
jeomxon a560367
refactor: (#338) null일 때만 수정하도록 검증 변경
jeomxon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
backend/src/main/java/com/votogether/domain/member/dto/MemberDetailRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.votogether.domain.member.dto; | ||
|
||
import com.votogether.domain.member.entity.Gender; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Max; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
@Schema(description = "회원 상세 정보 수정 요청") | ||
public record MemberDetailRequest( | ||
@Schema(description = "성별", example = "MALE") | ||
Gender gender, | ||
|
||
@Schema(description = "출생년도", example = "2000") | ||
@NotNull(message = "출생년도는 빈 값일 수 없습니다.") | ||
@Min(value = 1800, message = "출생년도는 1800년 이상부터 가능합니다.") | ||
@Max(value = 2100, message = "출생년도는 2100년 이하만 가능합니다.") | ||
Integer birthYear | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
P1
기획적으로 출생년도와 성별은 한번 입력하고 수정이 불가능한 것으로 알고 있습니다!
이미 출생년도와 성별이 지정되어 있는지에 대한 검증이 필요할 것 같아요 😙
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.
해당 API는 성별, 출생년도가
null
인 회원도 호출가능하게 해야null
인 회원이 수정할 수 있을 것 같아요 :)따라서 최상단에서 검증하는 로직이 빠져야할 것 같은데 제가 이해한게 맞을까요?! 🤔
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.
최상단에서 검증하는게
requestdto
에서 하는 검증인가요?requestdto
에서 빈값인지 검증하고해당 메서드에서는 회원의 성별, 출생년도가
null
일때만 수정할 수 있도록 조건을 걸어줘야할거같아요.-> 아니면 argumentResolver에서 성별, 출생년도가 매번 null인지 아닌지 확인하는 것보다 투표하는 메서드에서 성별, 출생년도가 null인 회원은 투표하지 못하게 막는건 어떤것 같나요?
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.
레전드 생각을 하고 있었네요!
다들 의견주셔서 감사합니다
수정해볼게요~