Skip to content

feature : #3 Knu 로그인 Api 이관#10

Open
kymokim wants to merge 3 commits into
developfrom
feature/#3
Open

feature : #3 Knu 로그인 Api 이관#10
kymokim wants to merge 3 commits into
developfrom
feature/#3

Conversation

@kymokim
Copy link
Copy Markdown
Contributor

@kymokim kymokim commented Feb 22, 2024

knu 로그인 api를 이관하였습니다.
정상 작동 확인은 되었으나 올바른 구조는 아닌 듯 하여 코멘트 및 #4 를 참고하여 수정, 보완하도록 하겠습니다 !

@kymokim kymokim requested a review from suhongkim98 February 22, 2024 14:24
Copy link
Copy Markdown
Contributor

@suhongkim98 suhongkim98 left a comment

Choose a reason for hiding this comment

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

마찬가지로 큰 틀만 일단 리뷰해드렸어요~~

Comment thread src/main/java/com/example/allknuauth/auth/adapter/in/web/KnuLoginController.java Outdated
Comment thread src/main/java/com/example/allknuauth/auth/adapter/in/web/KnuLoginController.java Outdated
Comment thread src/main/java/com/example/allknuauth/auth/adapter/out/web/KnuAuthAdapter.java Outdated
Comment thread src/main/java/com/example/allknuauth/global/configuration/WebClientConfig.java Outdated
Comment thread src/main/java/com/example/allknuauth/global/security/InterceptorConfig.java Outdated
@kymokim kymokim requested a review from suhongkim98 February 29, 2024 13:35
Copy link
Copy Markdown
Contributor

@suhongkim98 suhongkim98 left a comment

Choose a reason for hiding this comment

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

굳굳 수정 후 훨씬 괜찮아진 것 같아요~~!

throw new LoginFailedException(); // 사번이 1로 시작하는 교직원은 이용불가
}

Map<String, Object> responseList = loginKnuUseCase.loginKnu(loginDto.getId(), loginDto.getPassword());
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.

유즈케이스가 Map<String, Object> 를 리턴하도록 되어있는데 만약 map이 아닌 특정 필드를 추가해야하는 경우, 컨트롤러도 수정해주는 일이 생길 것 같아요.

dto를 리턴하도록 하고 컨트롤러에서는 기존 하위호환성 맞추기 위해 map을 꺼내 리턴하도록 하는게 어떨까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LoginKnuCommand 사용하여 리턴하도록 개선했습니다 !

public class LoginKnuService implements LoginKnuUseCase {

private final GetSessionInfoPort getSessionInfoPort;
private final GetStudentInfoPort getStudentInfoPort;
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.

나영이랑 상의해서 포트 컨벤션 맞추는게 좋을 것 같아요.

근데 get은 워낙에 이곳 저곳에서 많이 쓰이는 키워드라서 load..도 좋아보입니다..!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Load로 변경했습니다 !

responseList.put("studentInfo", studentInfo);

return responseList;
}
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.

굳굳 하나로 합쳤는데도 굉장히 깔끔하네여

private final ApiEndpointSecretProperties apiEndpointSecretProperties;

@Override
public Map<String, Object> getSessionInfo(Map<String, String> data){
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.

합친 것은 되게 좋았는데 하나로 합치는 과정에서 getSessionInfo 메서드의 책임이 너무 많아진 것 같아용
적절한 책임을 private 메서드로 따로 빼고 getSessionInfo메서드에서는 프라이빗 메서드를 호출하는 형태로 바꾸는게 어떨까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

각각의 load 함수 3개로 분리하였고, 공통적으로 사용되는 Jsoup.connect 함수도 모듈화했습니다.

@@ -0,0 +1,4 @@
package com.example.allknuauth.auth.domain;

public class Auth {
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
Contributor Author

Choose a reason for hiding this comment

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

삭제했습니다 !

@kymokim kymokim requested a review from suhongkim98 May 2, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants