-
Notifications
You must be signed in to change notification settings - Fork 0
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] 3차 리팩토링 진행 #209
Conversation
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.
수고하셨습니다~
우선 큰 문제는 없는 것 같아서 approve 해둘게요!
추가적으로 리뷰 관련하여 논의되면 좋을 것 같아요 :)
} catch (AuthException exception) { | ||
log.error("error : ", exception); | ||
final String token = getJwtFromRequest(request); | ||
if (StringUtils.hasText(token) && tokenValidator.validateToken(token) == VALID_JWT) { |
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.
if문 내부 코드가 별도 메소드로 분리되면 좋을 것 같아요 :)
...
if (isValidToken(token)) {
...
}
...
private boolean isValidToken(String token) {
return StringUtils.hasText(token) && tokenValidator.validateToken(token) == VALID_JWT;
}
log.error("error : ", exception); | ||
final String token = getJwtFromRequest(request); | ||
if (StringUtils.hasText(token) && tokenValidator.validateToken(token) == VALID_JWT) { | ||
Long userId = tokenValidator.getUserFromJwt(token); |
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.
null로 들어오는 경우가 있나요?? 래퍼타입(Long)이라 잘 몰라서 물어봅니닷!
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
|
||
@Builder(access = AccessLevel.PRIVATE) |
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.
컨벤션 통일을 위해 ENUM 타입은 import static으로 변경되면 좋을 것 같아요!
return badges.stream() | ||
.map(badge -> BadgeBaseServiceResponse.of(badge, memberBadges)) | ||
.toList(); |
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.
컨벤션 논의 필요
// 첫 글자가 공백인 경우 | ||
return !(username.charAt(0) == ' '); | ||
return !(Objects.equals(username.charAt(0),' ')); |
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.
코드로 충분히 파악할 수 있다고 생각하여, 주석은 제거해도 좋을 것 같다고 생각해요!
@@ -164,7 +164,7 @@ private void updateGoalType(Member member, GoalType goalType) { | |||
} | |||
} | |||
|
|||
private void updatePushAlarmConsent(Member member, Boolean hasAlarm) { | |||
private void updatePushAlarmConsent(Member member, final Boolean hasAlarm) { |
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.
hasAlarm은 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.
Entity 내부 메소드에서 null 체크 로직 포함하는 것으로 논의
return appleKeyList.keys().stream() | ||
.filter(appleKey -> | ||
Objects.equals(decodedAppleKey.alg(), appleKey.alg()) && | ||
Objects.equals(decodedAppleKey.kid(), appleKey.kid()) | ||
) |
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.
Objects.equals(decodedAppleKey.alg(), appleKey.alg()) &&
Objects.equals(decodedAppleKey.kid(), appleKey.kid())
해당 코드도 별도 메소드로 추출하면 직관적으로 가독성이 더 좋아질 것 같아요!
|
||
public String getKakaoData(final String accessToken) { | ||
try { | ||
RestClient restClient = RestClient.create(); |
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.
RestClient는 val 타입으로 지정하지 않은 이유가 있을까요??
1537d31
to
a595bf9
Compare
Related issue 🚀
Work Description 💚
3차 리팩토링을 진행했습니다.