-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 코스 구성 시 중복 빈도 선제적 파악 #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough
Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CourseService
participant CourseRepository
User->>CourseService: recommendCourses()
CourseService->>CourseRepository: fetchCandidates()
CourseService->>CourseService: getFilteredCandidates (거리 15km 제한)
loop 각 후보지
CourseService->>CourseService: findNextAreaDirectional (시간 30분~3시간, 방향성 X)
end
CourseService->>CourseService: isDuplicateCourse (80% 이상 중복 확인)
CourseService-->>User: 추천 코스 반환 (중복/거리/시간 필터 적용)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ 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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/com/opendata/domain/course/service/CourseService.java (1)
62-84: 중복 판단 로직이 잘 구현되었으나, 코스 크기 차이가 클 때의 처리를 고려해보세요.현재 구현은 대부분의 경우 잘 작동하지만, 코스 크기가 크게 다를 때 (예: 3개 vs 10개 구성) Math.min을 사용하면 의도와 다른 결과가 나올 수 있습니다.
예를 들어:
- 코스 A: 3개 구성 요소
- 코스 B: 10개 구성 요소, 그 중 3개가 A와 동일
현재 로직: 3/3 = 100% 중복으로 판단
대안: Jaccard 유사도 사용 (교집합/합집합)- double overlapRatio = (double) intersection / Math.min(newCourseIds.size(), existingIds.size()); + // Jaccard 유사도 사용: 교집합 크기 / 합집합 크기 + Set<Long> union = new HashSet<>(newCourseIds); + union.addAll(existingIds); + double overlapRatio = (double) intersection / union.size();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/com/opendata/domain/course/service/CourseService.java(5 hunks)
🔇 Additional comments (3)
src/main/java/com/opendata/domain/course/service/CourseService.java (3)
48-50: 중복 코스 필터링 로직이 적절히 구현되었습니다.최소 3개 이상의 구성 요소를 가진 코스만 추가하고, 중복 여부를 검사하는 로직이 PR 목표에 부합합니다.
96-96: 초기 후보 거리 제한 강화가 적절합니다.30km에서 15km로 거리 제한을 강화한 것은 더 밀집된 코스를 생성하고 중복 가능성을 줄이는 데 도움이 됩니다.
142-144: 시간 필터링 로직 개선이 우수합니다.30분에서 3시간 사이의 유연한 시간 범위는 다양한 속도의 관광 활동을 지원하며, 코스 구성의 유연성을 높입니다.
Also applies to: 158-159
| from.tourSpot().getAddress().getLatitude(), from.tourSpot().getAddress().getLongitude(), | ||
| a.tourSpot().getAddress().getLatitude(), a.tourSpot().getAddress().getLongitude() | ||
| ); | ||
| if (distance > 30.0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그 메시지의 거리 기준이 실제 필터와 일치하지 않습니다.
로그에서는 30km를 기준으로 출력하지만 실제 필터링은 15km로 적용됩니다.
- if (distance > 30.0) {
+ if (distance > 15.0) {Also applies to: 163-163
🤖 Prompt for AI Agents
In src/main/java/com/opendata/domain/course/service/CourseService.java at lines
150 and 163, the log messages mention a distance threshold of 30km, but the
actual filtering uses 15km. Update the log messages to reflect the correct 15km
distance threshold to ensure consistency between logs and filtering logic.
📌 PR 개요
✅ 변경사항
🔍 체크리스트
📎 관련 이슈
Closes #35
💬 기타 참고사항
Summary by CodeRabbit
신규 기능
버그 수정
개선 사항
정리