[Feat] 세모피드 도메인 구현#98
Conversation
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR implements a new SemoFeed feature: DB migration, JPA entity, repository, service, controller with Swagger docs, DTOs, and status code additions for SemoFeed and tracking-photo not-found. ChangesSemoFeed API Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/resources/db/migration/V14__create_semo_feeds.sql (1)
14-16: ⚡ Quick winAlign the public-feed index with the actual query sort.
Line 14–16 indexes only
is_public;findPublicalso orders bycreated_at DESC(src/main/java/com/semosan/api/domain/semofeed/repository/SemoFeedRepository.java, Line 13–14). This will still force sort work as data grows.📌 Suggested migration adjustment
-CREATE INDEX IF NOT EXISTS idx_semo_feeds_public - ON semo_feeds (is_public) - WHERE is_public = true; +CREATE INDEX IF NOT EXISTS idx_semo_feeds_public_created_at_desc + ON semo_feeds (created_at DESC) + WHERE is_public = true;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/resources/db/migration/V14__create_semo_feeds.sql` around lines 14 - 16, The current migration creates idx_semo_feeds_public only on is_public which doesn't support the ORDER BY used by findPublic; update the migration so the index covers both is_public and created_at (preserving the WHERE is_public = true predicate) so the query can use an index for the filtering and ordering; reference the index name idx_semo_feeds_public, table semo_feeds and the repository method findPublic to find where the change is needed and alter the CREATE INDEX statement accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/com/semosan/api/domain/semofeed/controller/SemoFeedController.java`:
- Around line 37-43: The listPublic controller currently relies on
`@PageableDefault`(size = 100) which is only a fallback; enforce the 100-item cap
by checking Pageable.getPageSize() inside listPublic and if it exceeds 100
replace the pageable with a new PageRequest (e.g.,
PageRequest.of(pageable.getPageNumber(), 100, pageable.getSort())) before
calling semoFeedService.listPublic(pageable); update the code path that builds
the PageResponse to use this capped pageable so clients cannot request size >
100.
---
Nitpick comments:
In `@src/main/resources/db/migration/V14__create_semo_feeds.sql`:
- Around line 14-16: The current migration creates idx_semo_feeds_public only on
is_public which doesn't support the ORDER BY used by findPublic; update the
migration so the index covers both is_public and created_at (preserving the
WHERE is_public = true predicate) so the query can use an index for the
filtering and ordering; reference the index name idx_semo_feeds_public, table
semo_feeds and the repository method findPublic to find where the change is
needed and alter the CREATE INDEX statement accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ce1a86a2-1fe9-4486-abd4-207795b0197e
📒 Files selected for processing (9)
src/main/java/com/semosan/api/common/status/ErrorStatus.javasrc/main/java/com/semosan/api/common/status/SuccessStatus.javasrc/main/java/com/semosan/api/domain/semofeed/controller/SemoFeedController.javasrc/main/java/com/semosan/api/domain/semofeed/controller/docs/SemoFeedControllerDocs.javasrc/main/java/com/semosan/api/domain/semofeed/dto/SemoFeedResponse.javasrc/main/java/com/semosan/api/domain/semofeed/entity/SemoFeed.javasrc/main/java/com/semosan/api/domain/semofeed/repository/SemoFeedRepository.javasrc/main/java/com/semosan/api/domain/semofeed/service/SemoFeedService.javasrc/main/resources/db/migration/V14__create_semo_feeds.sql
🧾 요약
🔗 이슈
✨ 변경 내용
✅ 확인
Summary by CodeRabbit