Skip to content

[Feat]#105 커뮤니티 응답에 작성자 프로필 이미지/캐릭터 코드 추가 - #109

Merged
Lee-Jungwoo merged 1 commit into
developfrom
feature/#105-profile-image-url
Aug 3, 2026
Merged

[Feat]#105 커뮤니티 응답에 작성자 프로필 이미지/캐릭터 코드 추가#109
Lee-Jungwoo merged 1 commit into
developfrom
feature/#105-profile-image-url

Conversation

@Lee-Jungwoo

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

Copy link
Copy Markdown
Contributor

게시글 목록/상세, 댓글 목록 응답에 작성자의 profileImageUrl 과
characterCode 를 추가한다. 프로필 이미지를 등록하지 않은 사용자는
profileImageUrl 이 null 이므로 characterCode 로 대체 표시한다.

  • 목록 조회는 기존 작성자 projection 이 이미 UserProfile 을 LEFT JOIN 하고 있어, SELECT 절에 컬럼만 추가해 추가 쿼리 없이 처리한다.
  • getWriters() 의 반환 타입을 projection 으로 변경하면서, Collectors.toMap 의 null value 방어용이던 닉네임 null 필터를 제거한다(값이 projection 객체라 null 이 될 수 없다). 응답 동작은 동일하다.
  • 댓글 목록은 작성자 프로필을 한 번만 조회해 세 필드를 함께 사용하므로 기존과 쿼리 수가 같다.

#️⃣연관된 이슈

#105

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요.(이미지 첨부 가능)

스크린샷 (선택)

💬리뷰 요구사항(선택)

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

PR 전 필수 체크리스트

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

테스트 결과

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

Summary by CodeRabbit

  • 새로운 기능
    • 커뮤니티 게시글 목록과 상세 화면에서 작성자의 프로필 이미지와 캐릭터 정보를 확인할 수 있습니다.
    • 댓글에도 작성자의 프로필 이미지와 캐릭터 정보가 함께 표시됩니다.
    • 프로필이 없는 작성자의 경우에도 게시글과 댓글을 정상적으로 확인할 수 있습니다.

게시글 목록/상세, 댓글 목록 응답에 작성자의 profileImageUrl 과
characterCode 를 추가한다. 프로필 이미지를 등록하지 않은 사용자는
profileImageUrl 이 null 이므로 characterCode 로 대체 표시한다.

- 목록 조회는 기존 작성자 projection 이 이미 UserProfile 을 LEFT JOIN
  하고 있어, SELECT 절에 컬럼만 추가해 추가 쿼리 없이 처리한다.
- getWriters() 의 반환 타입을 projection 으로 변경하면서, Collectors.toMap
  의 null value 방어용이던 닉네임 null 필터를 제거한다(값이 projection
  객체라 null 이 될 수 없다). 응답 동작은 동일하다.
- 댓글 목록은 작성자 프로필을 한 번만 조회해 세 필드를 함께 사용하므로
  기존과 쿼리 수가 같다.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Lee-Jungwoo Lee-Jungwoo self-assigned this Aug 3, 2026
Copilot AI review requested due to automatic review settings August 3, 2026 15:17
@Lee-Jungwoo Lee-Jungwoo added the 🐛 fix 버그 수정 label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 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: fa5f5e12-6922-44ff-8e03-679f6e59edf3

📥 Commits

Reviewing files that changed from the base of the PR and between 63054e8 and bb5cd8e.

📒 Files selected for processing (6)
  • src/main/java/com/redo/domain/community/converter/CommunityConverter.java
  • src/main/java/com/redo/domain/community/dto/res/CommunityCommentResponseDTO.java
  • src/main/java/com/redo/domain/community/dto/res/CommunityDetailResponseDTO.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

커뮤니티 게시글과 댓글 응답에 작성자의 profileImageUrlcharacterCode를 추가했습니다. Repository projection과 서비스 매핑을 확장했으며, 프로필이 없으면 관련 값은 null로 반환됩니다.

Changes

커뮤니티 작성자 프로필 응답

Layer / File(s) Summary
응답 계약과 변환 확장
src/main/java/com/redo/domain/community/dto/res/*, src/main/java/com/redo/domain/community/converter/CommunityConverter.java
게시글 목록·상세 응답과 댓글 응답에 profileImageUrl, characterCode를 추가했습니다. 변환기 메서드가 새 필드를 전달합니다.
작성자 projection과 게시글 목록 조회
src/main/java/com/redo/domain/community/repository/CommunityRepository.java, src/main/java/com/redo/domain/community/service/CommunityService.java
작성자 projection이 프로필 이미지 키와 캐릭터 코드를 반환합니다. 게시글 목록 서비스가 해당 값을 응답에 매핑합니다.
상세·댓글 프로필 매핑
src/main/java/com/redo/domain/community/service/CommunityService.java
게시글 상세와 댓글 목록이 UserProfile에서 닉네임, 프로필 이미지 URL, 캐릭터 코드를 추출합니다. 프로필 또는 이미지가 없으면 관련 값은 null입니다.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant CommunityService
  participant CommunityRepository
  participant CommunityConverter

  Client->>CommunityService: 게시글 목록 조회
  CommunityService->>CommunityRepository: 작성자 projection 조회
  CommunityRepository-->>CommunityService: 닉네임, 프로필 이미지 키, 캐릭터 코드
  CommunityService->>CommunityConverter: 게시글과 작성자 정보 전달
  CommunityConverter-->>Client: 프로필 정보가 포함된 응답 반환
Loading

Possibly related issues

Possibly related PRs

  • REDO-Team/Back#62: 동일한 커뮤니티 DTO, converter, repository, service 흐름에 작성자 프로필 정보를 확장합니다.
  • REDO-Team/Back#102: 동일한 커뮤니티 응답과 작성자 projection을 확장하는 코드 수준의 연관이 있습니다.
  • REDO-Team/Back#104: characterCodeprofileImageUrl을 사용자 프로필 응답에 전달하는 변경과 연결됩니다.

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.

@Lee-Jungwoo
Lee-Jungwoo merged commit 046e01a into develop Aug 3, 2026
1 of 2 checks passed

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

커뮤니티 게시글 목록/상세 및 댓글 목록 응답에 작성자 프로필 정보(profileImageUrl, characterCode)를 포함하도록 DTO/Converter/Service/Repository를 확장한 PR입니다. 기존 조회 흐름을 유지하면서(특히 목록 조회는 writer projection 기반) 응답 필드를 확장해 UI에서 프로필 이미지가 없을 때 캐릭터 코드로 대체 표시할 수 있게 합니다.

Changes:

  • 커뮤니티 목록/상세/댓글 응답 DTO에 profileImageUrl, characterCode 필드 추가
  • 목록 조회용 작성자 projection을 닉네임 → (닉네임/프로필 이미지 키/캐릭터 코드)로 확장
  • 서비스 레이어에서 프로필 조회 헬퍼를 도입하고 converter 호출 시 신규 필드 전달

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/com/redo/domain/community/service/CommunityService.java 목록/상세/댓글 응답 생성 시 작성자 프로필 필드까지 포함하도록 조회/매핑 로직 확장
src/main/java/com/redo/domain/community/repository/CommunityRepository.java 목록 조회용 writer projection 쿼리에 profileImageKey, characterCode 컬럼 추가
src/main/java/com/redo/domain/community/dto/res/CommunityResponseDTO.java 목록 응답 DTO에 작성자 프로필 필드 추가
src/main/java/com/redo/domain/community/dto/res/CommunityDetailResponseDTO.java 상세 응답 DTO에 작성자 프로필 필드 추가
src/main/java/com/redo/domain/community/dto/res/CommunityCommentResponseDTO.java 댓글 응답 DTO에 작성자 프로필 필드 추가
src/main/java/com/redo/domain/community/converter/CommunityConverter.java 신규 DTO 필드 반영을 위한 converter 시그니처/매핑 수정

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

Comment on lines 36 to 56
public static CommunityResponseDTO toCommunityResponse(
Community community,
long numComments,
String imageUrl,
String writer
String writer,
String profileImageUrl,
String characterCode
) {
return new CommunityResponseDTO(
community.getId(),
numComments,
community.getLikeCount() == null ? 0 : community.getLikeCount(),
community.getCreatedAt(),
imageUrl,
community.getTitle(),
String.valueOf(community.getCategory().getCode()),
toPreview(community.getContent()),
writer
writer,
profileImageUrl,
characterCode
);
Comment on lines 134 to 147
return CommunityConverter.toCommunityCommentListResponse(
comments.stream()
.map(comment -> CommunityConverter.toCommunityCommentResponse(
comment,
getNickname(comment.getUser().getId())
))
.map(comment -> {
UserProfile profile = getProfile(comment.getUser().getId());

return CommunityConverter.toCommunityCommentResponse(
comment,
getNickname(profile),
getProfileImageUrl(profile),
getCharacterCode(profile)
);
})
.toList()
);
@woo6629058
woo6629058 deleted the feature/#105-profile-image-url branch August 17, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 fix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants