-
Notifications
You must be signed in to change notification settings - Fork 0
코스 상세 조회 기능 추가 및 검색 서비스 리팩토링 #309
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
- DateSchedule과 Route의 양방향 관계를 OneToOne으로 재정의 - Route에서 불필요한 dateSchedules List 제거 - RoutePlace의 cascade 옵션 정리 및 OnDelete 어노테이션 제거 - DateSchedule과 Route 생성을 위한 팩토리 메서드 추가 - Route 복제 및 Place 관리 메서드 추가
- RouteController에 상세 조회 엔드포인트 및 RouteFacade 신규 도입 - RouteDetailDto 등 응답 구조를 위한 DTO 추가
- AlbumFacade, DateSchedService 등 연관 서비스 네이밍 및 쿼리 정리
Summary of ChangesHello @lovelyAlien, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 Pull Request는 코스 상세 조회 기능을 새롭게 추가하고, 기존 검색 서비스의 내부 로직을 리팩토링하여 전반적인 데이터 조회 효율성과 시스템 아키텍처의 명확성을 개선합니다. 특히, 코스에 포함된 장소, 사진, 리뷰 등의 연관 데이터를 더욱 효율적으로 가져오고 응답 구조를 최적화함으로써 사용자 경험을 향상시키는 데 중점을 두었습니다. 또한, 서비스 간의 의존성을 줄이고 불필요한 코드를 정리하여 유지보수성을 높였습니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Code Review
코스 상세 조회 기능 추가와 검색 서비스 리팩토링을 위한 PR 잘 보았습니다. 전반적으로 도메인 객체의 역할을 강화하고 서비스 간의 책임을 명확히 분리하려는 노력이 돋보입니다. 특히 RouteFacade를 도입하여 복잡한 조회 로직을 처리하고, RouteService와 SearchFacade의 역할을 재정의한 점이 인상적입니다. 제안드린 RouteFacade에서 발생할 수 있는 N+1 쿼리 문제, DateSchedService의 데이터 로딩 방식, 테스트 코드 보완 등에 대한 의견을 확인 부탁드립니다.
| Route sourceRoute = routeRepository.findById(sourceRouteId) | ||
| .orElseThrow(() -> new BusinessException(RouteErrorCode.NOT_FOUND)); | ||
|
|
||
| // RoutePlace 함께 로딩 (복제를 위해) | ||
| sourceRoute.getRoutePlaces().size(); // 초기화 |
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.
지연 로딩된 컬렉션을 초기화하기 위해 .size()를 호출하는 방식은 유효하지만, 데이터 로딩 시점을 명확하게 제어하기 위해 RouteRepository에 JOIN FETCH를 사용한 메서드를 추가하는 것을 고려해볼 수 있습니다. 예를 들어, findByIdWithRoutePlaces와 같은 메서드를 만들어 Route와 RoutePlace를 함께 조회하면, 서비스 코드에서 컬렉션 초기화를 위한 별도 호출 없이도 N+1 문제 없이 안전하게 연관 엔티티를 사용할 수 있습니다. 이렇게 하면 데이터 조회 로직이 리포지토리에 캡슐화되어 서비스 로직이 더 깔끔해집니다.
주요 변경 사항
관련 이슈
Closes #308