-
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
[#104] HttpSessionUtils 클래스 생성, 패키지 변경, 아주 약간의 리팩토링 #114
Conversation
- common 패키지 : 공통적으로 필요한 패키지를 모아둠. - common/exception 패키지 : 커스텀 예외 처리 클래스를 모아둠. - common/response 패키지 : 응답 객체를 모아둠. - domain 패키지 : entity 클래스와 repository를 모아둠.
- 로그인 세션과 관련된 기능을 모아둔 HttpSessionUtils 클래스 정의 - User 클래스에서만 사용하는 Gender enum을 중첩 enum 으로 선언 - ApiUserController에서 InvalidParameterException에 대한 에러 응답 객체를 반환하도록 변경
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 static final String FORBIDDEN = "접근 권한이 없습니다."; | ||
public static final String UNAUTHORIZED = "로그인이 필요합니다."; | ||
public static final String INVALID_PARAMETER = "Validation을 통과하지 못한 값 입니다."; |
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.
앗... 이거 그냥 Custom Exception으로 처리해주셔도 될 것 같아요..
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.
@ksundong Custom Exception 클래스에서 내부적으로 메세지를 가지고 있도록 말씀하시는걸까요?
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.
아니요 INVAILD_PARAMETER Exception은 Custom Exception이 아니거든요...
제가 Refactor 하겠습니다.
private HttpSessionUtils() {} | ||
|
||
public static Optional<User> getLoginedUserFromSession(HttpSession session) { | ||
return Optional.ofNullable((User)session.getAttribute(SESSION_LOGINED_USER)); |
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.
제가 원하던 겁니다. 👍
Closed #104
Closed #109