Skip to content

Conversation

@kyxxgsoo
Copy link
Contributor

@kyxxgsoo kyxxgsoo commented May 28, 2025

PR 타입(하나 이상의 PR 타입을 선택해주세요)

  • 기능 추가
  • 기능 삭제
  • 버그 수정
  • 의존성, 환경 변수, 빌드 관련 코드 업데이트

반영 브랜치

fix/#283/isLikedError -> develop

변경 사항

  • 답변 댓글 목록 조회 API

    • 기존 AnswerCommentInofs 리스트 반환 형식에서 SliceResponse를 반환하도록 변경하였습니다.
    • 좋아요 여부(isLiked), 본인 작성 여부(isMine) 필드를 Response에 추가하였습니다.
    • 답변 댓글 수 카운트를 캐싱하는 로직을 추가하였습니다.
    • SliceResponse<> 도입에 따른 인터페이를 추가하였습니다.
    • 기존의 코드
      public AnswerCommentInfos getAnswerCommentInfos(Long answerId) {
          List<AnswerCommentInfo> commentInfos = answerCommentRepository.findAnswerCommentByAnswerId(answerId).stream()
                  .map(answerCommentMapper::toAnswerCommentInfo)
                  .toList();
      
          return new AnswerCommentInfos(commentInfos);
      }
    • 변경된 코드
        public SliceResponse<AnswerCommentInfo> getAnswerCommentInfos(Long answerId, Long memberId, Long lastIndex, Pageable pageable) {
      
          Member member = memberService.findMember(memberId);
          Slice<AnswerCommentRDBDao.AnswerCommentInfoInterface> answerCommentSliceInterfaces = answerCommentRepository.findAnswerCommentByAnswerId(answerId, member, lastIndex, pageable);
      
          lastIndex = getLastIndexFromAnswerCommentInfoInterface(answerCommentSliceInterfaces);
      
          return SliceResponse.toSliceResponse(answerCommentSliceInterfaces, answerCommentSliceInterfaces.getContent().stream().map(
                  answerCommentInfoDto -> answerCommentMapper.toAnswerCommentInfo(
                          answerCommentInfoDto,
                          memberId
                  )
          ).toList(), lastIndex.toString(), answerCommentCountService.getAnswerCommentCount(answerId));
      
      }
  • 답변 댓글 좋아요 API

    • 답변 댓글 좋아요 API를 위한 AnswerCommentHeart 엔티티를 추가하였습니다.
    • 답변 댓글 좋아요를 토글하는 로직틀 추가하였습니다.

테스트 결과

  • 답변 댓글 조회 및 좋아요 토글 API
    image

@kyxxgsoo kyxxgsoo requested a review from jaewonLeeKOR May 28, 2025 10:02
@kyxxgsoo kyxxgsoo self-assigned this May 28, 2025
@kyxxgsoo kyxxgsoo added the ✨feature New feature or requeest label May 28, 2025
@kyxxgsoo kyxxgsoo linked an issue May 28, 2025 that may be closed by this pull request
2 tasks
@kyxxgsoo kyxxgsoo requested a review from jaewonLeeKOR May 30, 2025 10:13
Copy link
Member

@jaewonLeeKOR jaewonLeeKOR left a comment

Choose a reason for hiding this comment

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

indent 맞춰주세요.

@kyxxgsoo kyxxgsoo requested a review from jaewonLeeKOR June 5, 2025 06:06
Copy link
Member

@jaewonLeeKOR jaewonLeeKOR left a comment

Choose a reason for hiding this comment

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

고생했어요

@kyxxgsoo kyxxgsoo merged commit e913fe9 into develop Jun 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature New feature or requeest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 답변 / 댓글 isLiked 오류 수정

3 participants