Skip to content

Commit

Permalink
Merge pull request #101 from Team-Umbba/fix/#100-ending_event_response
Browse files Browse the repository at this point in the history
[FEAT] 모든 질답 완료 시 응답값 구분
  • Loading branch information
jun02160 authored Aug 24, 2023
2 parents ee39c8c + 900137f commit 698b641
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,15 @@ public GetMainViewResponseDto getMainInfo(Long userId) {

List<QnA> qnaList = getQnAListByParentchild(parentchild);

QnA lastQna = qnaList.get(parentchild.getCount()-1);
QnA currentQnA = qnaList.get(parentchild.getCount()-1);
log.info("getCount(): {}", parentchild.getCount());

return GetMainViewResponseDto.of(lastQna, parentchild.getCount());
if (parentchild.getCount() == 7 && (currentQnA.isParentAnswer() && currentQnA.isChildAnswer())) {
return GetMainViewResponseDto.of(currentQnA, parentchild.getCount()+1); // 유효하지 않은 8로 반환 시 엔딩이벤트
}


return GetMainViewResponseDto.of(currentQnA, parentchild.getCount());
}

@NotNull
Expand Down

0 comments on commit 698b641

Please sign in to comment.