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

[BE-94] 지원서 합/불 관리페이지 응답 오류 수정 #259

Merged
merged 5 commits into from
Sep 16, 2024

Conversation

LJH098
Copy link
Contributor

@LJH098 LJH098 commented Sep 16, 2024

개요

close #258

작업사항

  • 지원서 합/불 관리페이지 응답 오류 수정

변경로직

  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"))
                .name((String) result.get("name"))
                .id((String) result.get("id"))
                .year((Integer) result.get("year"))
                .state(state)
                .build();
    }
  • field3은 존재하지 않아 null로 반환되던 오류 수정
  • state는 아래와 같은 형식으로 응답되도록 수정
state : {
  passState : string
}

reference

@LJH098 LJH098 added bug-fix🚨 Bug Fix ( HotFix ) refactor♻️ This will not be worked on labels Sep 16, 2024
@LJH098 LJH098 self-assigned this Sep 16, 2024
Copy link
Collaborator

@Profile-exe Profile-exe left a comment

Choose a reason for hiding this comment

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

빠른 오류 해결 감사드립니다 👍 GetApplicantStatusResponse에서 궁금한 점이 있어 코멘트 남겼습니다!

Comment on lines 25 to 41
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();
}
Copy link
Collaborator

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;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

쌈뽕하네요 다른 이유는 없습니다. 밥먹으라는 어무이 잔소리를 들으면 이렇게 됩니다 ㅋㅋ
리뷰 반영할게요

Copy link
Collaborator

Choose a reason for hiding this comment

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

아하 ㅋㅋㅋㅋㅋ 네 좋습니다. 즐거운 추석 보내세용

Copy link
Collaborator

Choose a reason for hiding this comment

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

오 쌈뽕하네요

@LJH098 LJH098 merged commit 8e24db1 into develop Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix🚨 Bug Fix ( HotFix ) refactor♻️ This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants