-
Notifications
You must be signed in to change notification settings - Fork 8
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
[BE-94] 지원서 합/불 관리페이지 응답 오류 수정 #259
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.
빠른 오류 해결 감사드립니다 👍 GetApplicantStatusResponse
에서 궁금한 점이 있어 코멘트 남겼습니다!
public static GetApplicantsStatusResponse of(Map<String, Object> result) { | ||
ApplicantState state; | ||
if (result.get(PASS_STATE_KEY) instanceof ApplicantState applicantState) { | ||
state = applicantState; | ||
} else { | ||
throw ApplicantWrongStateException.wrongStatusException; | ||
} | ||
return GetApplicantsStatusResponse.builder() | ||
.field((String) result.get("field")) | ||
.field1((String) result.get("field1")) | ||
.field2((String) result.get("field2")) | ||
.field3((String) result.get("field3")) | ||
.name((String) result.get("name")) | ||
.id((String) result.get("id")) | ||
.year((Integer) result.get("year")) | ||
.state(result.get(PASS_STATE_KEY).toString()) | ||
.state(state) | ||
.build(); | ||
} |
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
문 안에 return
을 넣고 if
밖에서 throw
할 수 있을 것 같은데, else
를 사용하는 이유가 궁금합니다!
public static GetApplicantsStatusResponse of(Map<String, Object> result) {
if (result.get(PASS_STATE_KEY) instanceof ApplicantState applicantState) {
return GetApplicantsStatusResponse.builder()
.field((String) result.get("field"))
.field1((String) result.get("field1"))
.field2((String) result.get("field2"))
.field3((String) result.get("field3"))
.name((String) result.get("name"))
.id((String) result.get("id"))
.year((Integer) result.get("year"))
.state(result.get(PASS_STATE_KEY).toString())
.state(applicantState)
.build();
}
throw ApplicantWrongStateException.wrongStatusException;
}
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.
쌈뽕하네요 다른 이유는 없습니다. 밥먹으라는 어무이 잔소리를 들으면 이렇게 됩니다 ㅋㅋ
리뷰 반영할게요
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.
아하 ㅋㅋㅋㅋㅋ 네 좋습니다. 즐거운 추석 보내세용
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.
오 쌈뽕하네요
개요
close #258
작업사항
변경로직
reference