Skip to content

[BE-55] OauthServiceLocator 생성#25

Merged
Jaeyeop-Jung merged 4 commits intodevelopfrom
feature/BE-55
Dec 21, 2022
Merged

[BE-55] OauthServiceLocator 생성#25
Jaeyeop-Jung merged 4 commits intodevelopfrom
feature/BE-55

Conversation

@kdomo
Copy link
Copy Markdown
Member

@kdomo kdomo commented Dec 21, 2022

관련 이슈 번호

설명

변경사항

  • OauthServiceLocator 생성
  • MemberController에 endPoint loginType 카멜케이스로 변경
  • OauthService에 Service 어노테이션 붙임

질문사항

@kdomo kdomo requested a review from Jaeyeop-Jung as a code owner December 21, 2022 13:10
@kdomo kdomo self-assigned this Dec 21, 2022
@kdomo kdomo requested a review from Pull-Stack as a code owner December 21, 2022 13:10
if (!StringUtils.hasText(loginType)) {
throw new NullPointerException("로그인 타입이 없습니다.");
}
for (OauthService service : oauthServices) {
Copy link
Copy Markdown
Contributor

@Jaeyeop-Jung Jaeyeop-Jung Dec 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return oauthServices.stream() .filter(oauthService -> oauthService.getLoginType().name().equals(loginType)) .findAny() .orElseThrow(() -> new NullPointerException("일치하는 로그인 타입이 없습니다."));
여기 로직을 이렇게 하는건 어떨까요?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳 감사합니다 훨씬 깔끔하네요


public OauthService getOauthServiceByLoginType(String loginType) {
if (!StringUtils.hasText(loginType)) {
throw new NullPointerException("로그인 타입이 없습니다.");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'로그인 타입이 없습니다.' 보다는 '로그인 타입이 입력되지 않았습니다.' 이렇게 조금 더 명시적으로 하는게 어떨까요?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다!!

@Jaeyeop-Jung Jaeyeop-Jung merged commit bcd2b20 into develop Dec 21, 2022
@Jaeyeop-Jung Jaeyeop-Jung deleted the feature/BE-55 branch December 21, 2022 13:31
@kdomo kdomo restored the feature/BE-55 branch January 1, 2023 14:59
@kdomo kdomo deleted the feature/BE-55 branch January 1, 2023 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants