Conversation
|
Caution Review failedThe pull request is closed. WalkthroughRefactors post counters into a new PostStats entity/repository, migrates like/scrap/comment increments to PostStats, converts Post/PostComment to JPA entities, removes comment-like infrastructure, updates repositories/queries, adjusts controllers (pagination, security, docs), updates DTOs/tests, and tweaks scheduler import packages. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant API as LikePostController
participant UC as LikePostUseCaseImpl
participant PR as PostRepository
participant MR as MemberRepository
participant LR as LikedPostRepository
participant PS as PostStatsRepository
User->>API: POST /posts/{id}/like
API->>UC: likePost(postId, memberId)
UC->>PR: existsById(postId)
UC->>MR: existsById(memberId)
UC->>PR: getReferenceById(postId)
UC->>MR: getReferenceById(memberId)
UC->>LR: save(new LikedPost)
UC->>PS: incrementLike(postId)
UC->>PS: getLikeCount(postId)
UC-->>API: PostLikeResponse(postId, likeCount)
API-->>User: 200 OK
sequenceDiagram
actor User
participant API as ScrapPostController
participant UC as ScrapPostUseCaseImpl
participant PR as PostRepository
participant MR as MemberRepository
participant SR as MemberScrapRepository
participant PS as PostStatsRepository
User->>API: POST /posts/{id}/scrap
API->>UC: scrapPost(postId, memberId)
UC->>PR: existsById(postId)
UC->>MR: existsById(memberId)
UC->>PR: getReferenceById(postId)
UC->>MR: getReferenceById(memberId)
UC->>SR: save(new MemberScrap)
UC->>PS: incrementScrap(postId)
UC->>PS: getScrapNum(postId)
UC-->>API: ScrapPostResponse
API-->>User: 200 OK
sequenceDiagram
actor User
participant API as ManagePostController
participant UC as ManagePostUseCaseImpl
participant MR as MemberRepository
participant PR as PostRepository
participant PSR as PostStatsRepository
User->>API: POST /spot/posts (multipart)
API->>UC: createPost(memberId, PostCreateRequest)
UC->>MR: getReferenceById(memberId)
UC->>UC: uploadImageIfPresent()
UC->>PR: save(Post)
UC->>PSR: save(PostStats with 0 counters)
UC-->>API: PostCreateResponse
API-->>User: 201 Created
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (53)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
#️⃣ 연관된 이슈
🔎 작업 내용
PostStats) 분리likeCount, commentCount, hitCount, scrapNum필드를 별도 테이블로 이동Post / Comment엔티티에서 카운트 필드 제거PostStats를 통해 관리existsById/getReferenceById로 조회 최적화📷 스크린샷 (선택)
💬리뷰 요구사항 (선택)
Summary by CodeRabbit
New Features
Refactor
Documentation
Tests