Skip to content

Commit

Permalink
Merge pull request #154 from Modagbul/feat/alarm_minsu
Browse files Browse the repository at this point in the history
fix: 회원가입할 때 닉네임만 필수로 받게 수정
  • Loading branch information
minsu20 authored Dec 17, 2023
2 parents b0a2248 + b58fabf commit a80b335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ public class SignUpRequest {
@Size(min = 1, max = 10, message="nickName 은 최소 1개, 최대 10개의 문자만 입력 가능합니다.")
private String nickName;

@NotNull(message = "유효하지 않은 gender가 입력되었습니다.")
private Gender gender;

@NotNull(message="birthDate 을 입력해주세요.")
@Pattern(regexp = "^\\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$", message = "날짜 형식이 잘못되었습니다. YYYY-MM-DD 형식으로 입력해주세요.")
private String birthDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ public static Member valueOf(OAuth2User oAuth2User) {

public void signUp(SignUpRequest signUpRequest) {
this.nickName = signUpRequest.getNickName();
this.gender = signUpRequest.getGender();
this.birthDate = LocalDate.parse(signUpRequest.getBirthDate(), DateTimeFormatter.ISO_DATE);;
if(signUpRequest.getGender()!=null) {
this.gender = signUpRequest.getGender();
}
if(signUpRequest.getBirthDate()!=null) {
this.birthDate = LocalDate.parse(signUpRequest.getBirthDate(), DateTimeFormatter.ISO_DATE);
}
this.registrationStatus = RegistrationStatus.COMPLETED;
updateAllPush(true);
}
Expand Down

0 comments on commit a80b335

Please sign in to comment.