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] 회원가입시 일부 필드 null 허용하도록 리팩토링 #148

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/main/java/meltingpot/server/auth/service/AuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ public AccountResponseDto signup(SignupRequestDto signupRequest) {
.build()).toList()
);

account.setLanguages(signupRequest.languages().stream().map(
(language) -> AccountLanguage.builder()
.account(account)
.language(language)
.build()).toList()
);
if(signupRequest.languages()!=null){
account.setLanguages(signupRequest.languages().stream().map(
(language) -> AccountLanguage.builder()
.account(account)
.language(language)
.build()).toList());
}

accountRepository.save(account);

Expand Down
14 changes: 8 additions & 6 deletions src/main/java/meltingpot/server/auth/service/OAuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ public OAuthSignInResponseDto oauthSignup(OAuthSignupRequestDto signupRequest) {
.build()).toList()
);

if(signupRequest.languages()!=null) {
account.setLanguages(signupRequest.languages().stream().map(
(language) -> AccountLanguage.builder()
.account(account)
.language(language)
.build()).toList()
);
}

account.setLanguages(signupRequest.languages().stream().map(
(language) -> AccountLanguage.builder()
.account(account)
.language(language)
.build()).toList()
);

accountRepository.save(account);

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/meltingpot/server/domain/entity/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ public class Account extends BaseEntity {

private String password;

@NotNull
@Enumerated(EnumType.STRING)
private Gender gender;

@NotNull
private LocalDate birth;

@NotNull
private String nationality;

private String bio; // 사용자 자기소개
Expand Down