Skip to content

[feat] 리피드 카운트 추가#120

Merged
gkdudans merged 2 commits intodevelopfrom
feat/feed/hyun
Aug 12, 2025
Merged

[feat] 리피드 카운트 추가#120
gkdudans merged 2 commits intodevelopfrom
feat/feed/hyun

Conversation

@doehy
Copy link
Contributor

@doehy doehy commented Aug 12, 2025

#️⃣ Issue Number

📝 요약(Summary)

리피드 카운트 명시

🛠️ PR 유형

어떤 변경 사항이 있나요?

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

📸스크린샷 (선택)

💬 공유사항 to 리뷰어

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

Summary by CodeRabbit

  • New Features
    • 피드 상세 화면에 리포스트 수가 표시됩니다.
    • 피드 목록(오버뷰)에서도 각 피드의 리포스트 수가 함께 보여집니다.
    • 부모/루트 피드가 있는 경우, 관련 피드들의 리포스트 수가 함께 반영되어 더 풍부한 맥락을 제공합니다.
    • 인기 피드 보기 기능이 추가되어, 관심 높은 피드를 한눈에 확인할 수 있습니다.

@doehy doehy requested review from ghkddlscks19 and gkdudans August 12, 2025 05:14
@doehy doehy self-assigned this Aug 12, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

피드 DTO(상세·개요)에 repostCount 필드가 추가되었고, 상세 DTO의 from(...) 시그니처가 변경되었습니다. FeedRepository에 리포스트 집계용 메서드와 프로젝션이 추가되었습니다. FeedMainService에 공통 조회/인기 피드 흐름이 도입되고, 리포스트 카운트 집계·전파 로직과 대량 선조회가 추가되었습니다. FeedService는 상세 조회 시 리포스트 수를 조회해 DTO로 전달합니다.

Changes

Cohort / File(s) Change Summary
DTOs: Repost 필드 추가
src/main/java/.../dto/response/FeedDetailResponseDto.java, src/main/java/.../dto/response/FeedOverviewDto.java
상세/개요 DTO에 repostCount: Long 필드 추가. FeedDetailResponseDto.from(...) 시그니처에 long repostCount 인자 추가 및 빌더 할당.
Repository: 리포스트 집계
src/main/java/.../repository/FeedRepository.java
countByParent_FeedId(Long) 추가. countDirectRepostsIn(List<Long>) JPQL 집계 쿼리 및 프로젝션 ParentRepostCount { getParentId(); getCnt(); } 추가.
Service: 메인 피드 공통화/인기 피드
src/main/java/.../service/FeedMainService.java
getFeedsCommon(pageable, popular) 도입, getPersonalFeed/신규 getPopularFeed가 위임. 접근 가능한 클럽 계산, 조건 분기 조회, 리포스트 카운트 집계, 부모/루트 대량 선조회, DTO 매핑 시 리포스트 수 전파.
Service: 상세 조회 리포스트 카운트 반영
src/main/java/.../service/FeedService.java
상세 조회에서 countByParent_FeedId(feedId)로 리포스트 수 조회 후 FeedDetailResponseDto.from(..., repostCount)로 전달. 기존 로직은 유지.

Sequence Diagram(s)

sequenceDiagram
  actor Client
  participant FeedMainService
  participant FeedRepository as Repo

  Client->>FeedMainService: getPersonalFeed(pageable) / getPopularFeed(pageable)
  FeedMainService->>FeedMainService: resolveAccessibleClubIds(userId)
  alt popular == true
    FeedMainService->>Repo: findPopularByClubIds(clubIds, pageable)
  else
    FeedMainService->>Repo: findByClubIds(clubIds, pageable)
  end
  FeedMainService->>Repo: countDirectRepostsIn(feedIds)
  FeedMainService->>Repo: bulk load parents/roots (batched lookups)
  FeedMainService->>FeedMainService: map to DTOs with repostCount
  FeedMainService-->>Client: List<FeedOverviewDto>
Loading
sequenceDiagram
  actor Client
  participant FeedService
  participant FeedRepository as Repo

  Client->>FeedService: getFeedDetail(feedId)
  FeedService->>Repo: findById(feedId), load images/comments/likes
  FeedService->>Repo: countByParent_FeedId(feedId)
  FeedService->>FeedService: FeedDetailResponseDto.from(..., repostCount)
  FeedService-->>Client: FeedDetailResponseDto
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Feed

Suggested reviewers

  • ghkddlscks19
  • gkdudans
  • geleego

Poem

귀가 쫑긋, 깡총깡총 코드밭을 달려와
리포스트 셈하니, 숫자들이 춤을 춰!
루트와 부모도 함께 손잡고 카운트 업,
인기 피드 줄 맞춰 토끼도 엄지 척.
오늘도 나는 버그 대신 캐롯을 업! 🥕


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8421433 and 8104e94.

📒 Files selected for processing (5)
  • src/main/java/com/example/onlyone/domain/feed/dto/response/FeedDetailResponseDto.java (2 hunks)
  • src/main/java/com/example/onlyone/domain/feed/dto/response/FeedOverviewDto.java (1 hunks)
  • src/main/java/com/example/onlyone/domain/feed/repository/FeedRepository.java (1 hunks)
  • src/main/java/com/example/onlyone/domain/feed/service/FeedMainService.java (5 hunks)
  • src/main/java/com/example/onlyone/domain/feed/service/FeedService.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/feed/hyun

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@gkdudans gkdudans changed the title [Feat] 리피드 카운트 [feat] 리피드 카운트 추가 Aug 12, 2025
@gkdudans gkdudans merged commit 1c4a5b0 into develop Aug 12, 2025
1 check was pending
@coderabbitai coderabbitai bot mentioned this pull request Aug 14, 2025
13 tasks
choigpt pushed a commit that referenced this pull request Aug 28, 2025
[feat] 리피드 카운트 추가
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