[feat] #44 home 구현#50
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds home-screen mountain features: map-bounds mountain lookup, level-based recommendations, and per-mountain paged user hiking-records; includes DTOs/projections, native repository queries, service logic, controller endpoints, OpenAPI docs, and status/error codes. ChangesHome feature implementation
Sequence Diagram(s)sequenceDiagram
participant Client
participant MountainController
participant MountainService
participant MountainRepository
participant UserOnboardingRepository
participant HikingMemberRepository
participant Database
Client->>MountainController: GET /api/mountains/map or /api/mountains/recommendations
MountainController->>MountainService: getMountainsForMap(...) / getRecommendedMountains(...)
MountainService->>MountainRepository: findInBBoxWithUserHikingStats(...) / findRecommendationsByDifficulties(...)
MountainService->>UserOnboardingRepository: findByUserId(userId)
MountainService->>HikingMemberRepository: existsByUser_Id(userId)
MountainRepository->>Database: native SELECT queries
MountainService-->>MountainController: MountainMapListResponse / Page<MountainRecommendationResponse>
MountainController-->>Client: ApiResponse.success(...)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 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
🤖 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/mountain/service/MountainService.java`:
- Around line 63-67: The current logic in MountainService that computes
hasFullBBox and then sets
resolvedSwLat/resolvedSwLng/resolvedNeLat/resolvedNeLng silently falls back to
Seoul defaults whenever any of swLat, swLng, neLat, neLng are not all present;
change it so defaults are applied only when all four coordinates are null (i.e.,
the entire bbox is missing), and if some but not all bbox fields are provided
return a BAD_REQUEST (throw a suitable exception such as
IllegalArgumentException or ResponseStatusException) indicating incomplete bbox
input; update the code that currently uses hasFullBBox and the resolved*
variables (swLat, swLng, neLat, neLng, hasFullBBox, resolvedSwLat,
resolvedSwLng, resolvedNeLat, resolvedNeLng) to implement this validation and
error path.
🪄 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: 73dffa98-1e87-4312-9545-aa1413eba17b
📒 Files selected for processing (16)
src/main/java/com/semosan/api/common/status/SuccessStatus.javasrc/main/java/com/semosan/api/domain/hiking/controller/HikingRecordController.javasrc/main/java/com/semosan/api/domain/hiking/controller/docs/HikingRecordControllerDocs.javasrc/main/java/com/semosan/api/domain/hiking/dto/response/GetUserHikingRecordResponse.javasrc/main/java/com/semosan/api/domain/hiking/repository/HikingMemberRepository.javasrc/main/java/com/semosan/api/domain/hiking/repository/HikingRecordRepository.javasrc/main/java/com/semosan/api/domain/hiking/repository/projection/UserHikingRecordProjection.javasrc/main/java/com/semosan/api/domain/hiking/service/HikingRecordService.javasrc/main/java/com/semosan/api/domain/mountain/controller/MountainController.javasrc/main/java/com/semosan/api/domain/mountain/controller/docs/MountainControllerDocs.javasrc/main/java/com/semosan/api/domain/mountain/dto/response/MountainMapListResponse.javasrc/main/java/com/semosan/api/domain/mountain/dto/response/MountainMapResponse.javasrc/main/java/com/semosan/api/domain/mountain/dto/response/MountainRecommendationResponse.javasrc/main/java/com/semosan/api/domain/mountain/repository/MountainRepository.javasrc/main/java/com/semosan/api/domain/mountain/repository/projection/MountainMapProjection.javasrc/main/java/com/semosan/api/domain/mountain/service/MountainService.java
# Conflicts: # src/main/java/com/semosan/api/domain/hiking/repository/HikingMemberRepository.java # src/main/java/com/semosan/api/domain/mountain/service/MountainService.java
howooyeon
left a comment
There was a problem hiding this comment.
수고하셨습니당~ 몇가지 코멘트 남겼습니다!
- BBox 지도 조회: visitCount 상관 서브쿼리를 LEFT JOIN + GROUP BY로 치환 (COUNT(hm.user_id)) - 레벨추천 정렬: 경도항에 COS(RADIANS(lat)) 보정 추가 - MountainMapResponse.visitCount 타입을 Long으로 통일
같은 서비스 내 다른 내 등산기록 API와 정책 일관성 맞춤
🧾 요약
🔗 이슈
✨ 변경 내용
신규 API
GET /api/mountains/map?swLat=&swLng=&neLat=&neLng=hasHikingRecord(유저 전체 등산 기록 유무) 플래그 포함 → 프론트 빈 상태 분기용GET /api/mountains/recommendations?lat=&lng=&page=&size=id ASC로 페이지 간 일관성 보장GET /api/hiking-records/me/mountains/{mountainId}응답 DTO 변경 (중요!)
GetUserHikingRecordResponse.imageUrl: String→imageUrls: List<String>GET /api/hiking-records/me,GET /api/hiking-records/me/mountains/{mountainId}photoReportImageUrl우선 →cliveImageUrl(null 필드는 제외)신규 파일
domain/mountain/dto/response/MountainMapResponse,MountainMapListResponse,MountainRecommendationResponsedomain/mountain/repository/projection/MountainMapProjection홈 관련 더 해야할 것들
✅ 확인
Summary by CodeRabbit
New Features
Bug Fixes / Validation