[BUG] 지도 핀 조회 응답에 할인 정보 추가#364
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a discount field to map pins, updating the repository queries, view interfaces, DTOs, and mapping logic. The reviewer suggests introducing a common base interface (MapPinBaseView) for MapPinView and MapPinClusterView to eliminate duplicate mapping logic in MapPinQueryServiceImpl.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| view.getLat(), | ||
| view.getLng(), | ||
| view.getDetailAddress(), | ||
| view.getRegion() | ||
| view.getRegion(), | ||
| view.getDiscount() | ||
| ); |
There was a problem hiding this comment.
현재 MapPinView와 MapPinClusterView는 대부분의 메서드(getPinId, getPinType, getLat, getLng, getDetailAddress, getRegion, getDiscount)를 공통으로 가지고 있습니다. 이로 인해 MapPinQueryServiceImpl에서 동일한 변환 로직을 가진 toDto 메서드가 중복으로 구현되어 있습니다.
공통 상위 인터페이스를 도입하여 중복 코드를 제거하고 유지보수성을 향상시키는 것을 제안합니다.
적용 예시:
- 공통 인터페이스 정의 (
MapPinBaseView.java):
public interface MapPinBaseView {
Long getPinId();
String getPinType();
Double getLat();
Double getLng();
String getDetailAddress();
String getRegion();
String getDiscount();
}- 기존 인터페이스가 상속받도록 수정:
public interface MapPinView extends MapPinBaseView {}
public interface MapPinClusterView extends MapPinBaseView {
Double getClusterLat();
Double getClusterLng();
}MapPinQueryServiceImpl에서 단일toDto메서드로 통합:
private MapPinResDTO.PinItemDTO toDto(MapPinBaseView view) {
return new MapPinResDTO.PinItemDTO(
view.getPinId(),
view.getPinType(),
view.getLat(),
view.getLng(),
view.getDetailAddress(),
view.getRegion(),
view.getDiscount()
);
}
🔗 Related Issue
✨ 작업 개요
지도 핀 조회 응답에 할인 정보를 추가합니다.
두 API에 할인정보가 추가되었습니다.
체크리스트
📷 이미지 첨부 (선택)
🧐 집중 리뷰 요청