-
Notifications
You must be signed in to change notification settings - Fork 1
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(#37): 회원 이름 이메일 저장 #52
The head ref may contain hidden characters: "feature/#37-\uD68C\uC6D0-\uC774\uB984-\uC774\uBA54\uC77C-\uC800\uC7A5"
Conversation
Test Results39 tests 38 ✅ 2s ⏱️ Results for commit 13560d8. ♻️ This comment has been updated with latest results. |
64b398d
to
14ecfc0
Compare
private SocialAccount createSocialAccount( | ||
final Member member, final String oauthId, final SocialProvider socialProvider) { | ||
return SocialAccountFixture.builder() | ||
.member(member) | ||
.oauthId(oauthId) | ||
.socialProvider(socialProvider) | ||
.build(); | ||
} | ||
|
||
private AppleLoginCommand createAppleLoginCommand(String idToken, String name) { | ||
return new AppleLoginCommand(idToken, name); | ||
} | ||
|
||
private KakaoLoginCommand createKakaoLoginCommand(String authorizationCode, String redirectUri) { | ||
return new KakaoLoginCommand(authorizationCode, redirectUri); | ||
} | ||
|
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.
IntelliJ 설정에서 Actions on Save를 사용하고 있는데 자동으로 포맷팅해서 메서드가 클래스 위로 올라와 버렸습니다 😭
가독성에 방해된다면 해당 옵션 끄고 원상 복귀하여 다시 커밋하겠습니다..!
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.
고생하셨습니다 !!!
private String email; | ||
|
||
private Member(final String name, final String email) { | ||
this.name = name; | ||
this.email = email; | ||
} |
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.
pn2. 별건 아닌데 email 검증해주는건 어떤가요 ?? 아니면 email을 VO로 만들어서 써도 좋을 것 같아여 !
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.
이건 다른 pr에 병목이 생길 것 같아 추후에 이슈 열어서 작업해보겠습니다!
.../src/test/java/org/nexters/jaknaesocore/domain/auth/service/OauthServiceIntegrationTest.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.
고생하셨습니다! 코멘트한 부분 수정 부탁드려요!
public record KakaoUserInfoResponse( | ||
@JsonProperty("id") Long id, @JsonProperty("kakao_account") KakaoAccount kakaoAccount) { | ||
|
||
@JsonProperty("id") | ||
Long id; | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record KakaoAccount( | ||
@JsonProperty("name") String name, @JsonProperty("email") String email) {} | ||
} |
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.
inner class👍 👍 👍
private Member findMemberWithSocialProvider( | ||
final String oauthId, final SocialProvider socialProvider) { | ||
return socialAccountRepository | ||
.findByOauthIdAndSocialProviderAndDeletedAtIsNull(oauthId, socialProvider) | ||
.map(SocialAccount::getMember) | ||
.filter(member -> member.getDeletedAt() == null) | ||
.orElse(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.
pn2. filter
@Query
사용해서 join을 하고,member.deletedAt is 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.
체이닝으로 변경하면서 사라졌습니다!
- 지금 생각하니 쿼리 어노테이션으로 확인해도 되고
- member 삭제 시 같이 삭제되니까 social account 의 deleted at 만 확인해도 되는 것 같네요
jaknaeso-core/src/main/java/org/nexters/jaknaesocore/domain/auth/service/OauthService.java
Outdated
Show resolved
Hide resolved
private String email; | ||
|
||
private Member(final String name, final String email) { | ||
this.name = name; | ||
this.email = email; | ||
} |
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.
시간되면 해주세요! 나중에 리팩토링해도 괜찮구요!
.../src/test/java/org/nexters/jaknaesocore/domain/auth/service/OauthServiceIntegrationTest.java
Show resolved
Hide resolved
jaknaeso-core/src/main/java/org/nexters/jaknaesocore/domain/auth/service/OauthService.java
Outdated
Show resolved
Hide resolved
애플은 최초 로그인할 때만 name 값을 전달하므로 로그인 시엔 email만 업데이트 한다
jaknaeso-core/src/main/java/org/nexters/jaknaesocore/domain/auth/service/OauthService.java
Outdated
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.
고생하셨습니다!
작업 개요
소셜 로그인 시 회원 이름 및 이메일 저장
작업 사항
kakao_account
의name
,email
도 받아오도록 수정