Skip to content

Conversation

@leebs0521
Copy link
Collaborator

resolved :

📌 과제 설명

특정 모집글에 대한 봉사자 지원 조회시 작성 리뷰 여부 필드 추가

👩‍💻 요구 사항과 구현 내용

image

✅ PR 포인트 & 궁금한 점

@leebs0521 leebs0521 self-assigned this Jan 7, 2025
@leebs0521 leebs0521 linked an issue Jan 7, 2025 that may be closed by this pull request
1 task
Copy link
Collaborator

@m-a-king m-a-king left a comment

Choose a reason for hiding this comment

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

수고하셨씁니다~

코드 스타일이 조금 달라지셨네요.
개행을 줄이셨는데 이유가 있으신가요?

@Schema(description = "봉사 참여 여부", example = "false")
Boolean attended,
@Schema(description = "리뷰 작성 여부", example = "false")
Boolean isReviewed,
Copy link
Collaborator

Choose a reason for hiding this comment

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

제가 이겼군요...

@Override
public VolunteerApplyWithReviewStatusResponseDto getVolunteerApplyByRecruitIdAndVolunteerId(Long recruitId, UUID volunteerId) {
VolunteerApply apply = volunteerApplyQueryUseCase.getByRecruitIdAndVolunteerId(recruitId, volunteerId);
boolean isReviewed = checkIfReviewed(apply);
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 Author

Choose a reason for hiding this comment

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

음.. 봉사 지원과 리뷰의 관계를 생각해봤을때, 봉사지원(상태가 APPROVED이고 참석여부가 TRUE일때)일때, 리뷰가 있을수도(작성했을 수도)없을 수도 있어서 위 메서드로 빼놨습니다.

즉, 리뷰 작성 가능성이 있을때, ReviewQueryUseCase로 조회하도록 했습니다.

@leebs0521
Copy link
Collaborator Author

leebs0521 commented Jan 8, 2025

코드 스타일이 조금 달라지셨네요.
개행을 줄이셨는데 이유가 있으신가요?

@m-a-king 이전에 작성했던건 구글 컨벤션이어서.. 저번에 다시 default로 바꾸고 나서 코드 정렬 단축키 누르니까 바뀌는게 있더라구요.

throw new BadRequestException(UNAUTHORIZED_RECRUIT_BOARD);
private boolean checkIfReviewed(VolunteerApply apply) {
return apply.isVolunteerActivityCompleted()
&& reviewQueryUseCase.existsByVolunteerApplyId(apply.getId());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@m-a-king
apply.isVolunteerActivityCompleted() == true 이면
reviewQueryUseCase.existsByVolunteerApplyId(apply.getId()) 이부분이 호출되면서 리뷰 작성 여부를 반환합니다.

반대로 전자가 false면 후자는 실행을 안하니까 조회 한번을 아낄수 있어요

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

@ayoung-dev ayoung-dev left a comment

Choose a reason for hiding this comment

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

고생하셨습니다

@leebs0521 leebs0521 force-pushed the feature/279-add-volunteer-apply-query-field branch from 601d879 to fb1f847 Compare January 8, 2025 07:59
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2025

@leebs0521 leebs0521 merged commit f427183 into main Jan 8, 2025
3 checks passed
@leebs0521 leebs0521 deleted the feature/279-add-volunteer-apply-query-field branch January 8, 2025 08:07
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.

[FEATURE] 특정 모집글 봉사자 지원 조회 필드 추가

5 participants