Skip to content
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] 개별 프로필 조회 비즈니스 로직 리팩터링 #145

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

gardening-y
Copy link
Member

Related Issue 📌

close #143

Description ✔️

  • Result의 결과값을 Integer로 변경해서 null 값을 받을 수 있게 해준 뒤, 기존의 try catch 문을 getResult()의 null의 유무를 확인하는 것으로 변경해 값이 없을 경우 -1을 반환해주도록 리팩터링하였습니다.

Copy link
Member

@SunwoongH SunwoongH left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +212 to +217
if (user.getResult() == null) {
return -1;
}
else {
return user.getResult().getNumResult();
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (user.getResult() == null) {
return -1;
}
else {
return user.getResult().getNumResult();
}
if (user.getResult() == null) {
return -1;
}
return user.getResult().getNumResult();

early return을 활용해봐도 좋을 것 같습니다~
그리고 -1을 문자열 상수로 정의해서 사용해도 좋을 것 같습니다.

@gardening-y gardening-y merged commit a80c6f7 into develop Mar 7, 2024
1 check passed
@SunwoongH SunwoongH deleted the feature/143 branch July 11, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[refactor] 개별 프로필 조회 비즈니스 로직 리팩터링
2 participants