Skip to content

[Feat]#101 커뮤니티 게시글 api응답 누락 정보 추가 - #102

Merged
Lee-Jungwoo merged 1 commit into
developfrom
feature/#101-community-api
Aug 1, 2026
Merged

[Feat]#101 커뮤니티 게시글 api응답 누락 정보 추가#102
Lee-Jungwoo merged 1 commit into
developfrom
feature/#101-community-api

Conversation

@Lee-Jungwoo

@Lee-Jungwoo Lee-Jungwoo commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

#️⃣연관된 이슈

#101

📝작업 내용

커뮤니티 게시글 api응답 누락 정보 추가
좋아요 갯수, 미리보기, 작성자명 추가

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.

PR 전 필수 체크리스트

  • 관련 이슈를 연결했습니다.
  • 로컬에서 정상 동작을 확인했습니다.
  • 필요한 테스트를 수행했습니다.
  • Swagger/API 명세를 업데이트했습니다.
  • 불필요한 로그 또는 주석을 제거했습니다.

테스트 결과

  • 단위 테스트
  • 통합 테스트
  • Swagger 테스트
  • Postman 테스트
  • 직접 실행 확인

Summary by CodeRabbit

  • 새 기능
    • 커뮤니티 게시글 목록에 작성자 닉네임과 좋아요 수를 표시합니다.
    • 본문 미리보기를 제공하며, 20자를 초과하면 말줄임표로 표시합니다.
    • 작성자 프로필이 없거나 닉네임이 없는 경우에도 게시글 목록을 정상적으로 표시합니다.

Copilot AI review requested due to automatic review settings August 1, 2026 09:10
@Lee-Jungwoo
Lee-Jungwoo merged commit 3bb6311 into develop Aug 1, 2026
1 check was pending
@Lee-Jungwoo
Lee-Jungwoo deleted the feature/#101-community-api branch August 1, 2026 09:10
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 95976d01-e51d-4082-bf50-e1412c342800

📥 Commits

Reviewing files that changed from the base of the PR and between ff88d12 and 645b3ff.

📒 Files selected for processing (4)
  • src/main/java/com/redo/domain/community/converter/CommunityConverter.java
  • src/main/java/com/redo/domain/community/dto/res/CommunityResponseDTO.java
  • src/main/java/com/redo/domain/community/repository/CommunityRepository.java
  • src/main/java/com/redo/domain/community/service/CommunityService.java

📝 Walkthrough

Walkthrough

커뮤니티 목록 응답에 좋아요 수, 본문 미리보기, 작성자 닉네임을 추가했습니다. 작성자 닉네임은 목록 단위로 조회하며, 본문은 최대 20자로 변환합니다.

Changes

커뮤니티 목록 응답

Layer / File(s) Summary
응답 계약 및 변환
src/main/java/com/redo/domain/community/dto/res/CommunityResponseDTO.java, src/main/java/com/redo/domain/community/converter/CommunityConverter.java
CommunityResponseDTO에 좋아요 수, 미리보기, 작성자 필드를 추가했습니다. 좋아요 수가 null이면 0으로 설정합니다. 본문은 20자를 초과하면 ...을 추가합니다.
작성자 닉네임 조회 연동
src/main/java/com/redo/domain/community/repository/CommunityRepository.java, src/main/java/com/redo/domain/community/service/CommunityService.java
커뮤니티와 사용자 프로필을 LEFT JOIN하여 작성자 닉네임을 일괄 조회합니다. 닉네임이 null이면 맵에서 제외하고 응답에는 null을 전달합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CommunityService
  participant CommunityRepository
  participant CommunityConverter
  CommunityService->>CommunityRepository: 작성자 닉네임 일괄 조회
  CommunityRepository-->>CommunityService: 커뮤니티 ID와 닉네임 반환
  CommunityService->>CommunityConverter: 커뮤니티와 작성자 전달
  CommunityConverter-->>CommunityService: CommunityResponseDTO 반환
Loading

Possibly related PRs

  • REDO-Team/Back#62: 현재 변경이 확장하는 커뮤니티 목록 응답과 관련된 기존 구현을 추가했습니다.

Suggested reviewers: copilot, woo6629058

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

커뮤니티 게시글 “목록/미리보기” 응답에 누락되었던 정보를 보강해, 클라이언트가 목록 화면에서 필요한 데이터를 추가 호출 없이 받을 수 있도록 개선하는 PR입니다.

Changes:

  • 목록 응답 DTO에 좋아요 수(numLikes), 본문 미리보기(preview), 작성자명(writer) 필드를 추가
  • 목록 조회 시 작성자 닉네임을 N+1 없이 한 번의 쿼리로 조회하는 repository/service 로직 추가
  • 목록 응답 변환 시 본문 미리보기 생성 로직 추가

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/main/java/com/redo/domain/community/service/CommunityService.java 목록 조회 시 작성자 닉네임 맵을 추가로 조회해 응답 변환에 포함
src/main/java/com/redo/domain/community/repository/CommunityRepository.java 게시글별 작성자 닉네임을 projection으로 일괄 조회하는 JPQL 쿼리 추가
src/main/java/com/redo/domain/community/dto/res/CommunityResponseDTO.java 목록 응답에 좋아요 수/미리보기/작성자명을 포함하도록 DTO 확장
src/main/java/com/redo/domain/community/converter/CommunityConverter.java 목록 응답 변환 시 좋아요 수/미리보기/작성자명 매핑 로직 추가

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +29 to +31
// 목록의 본문 미리보기 노출 길이. 이 길이를 넘으면 잘라내고 말줄임표를 붙인다.
private static final int PREVIEW_LENGTH = 20;
private static final String PREVIEW_ELLIPSIS = "...";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants