-
Notifications
You must be signed in to change notification settings - Fork 1
[Hot fix] 웨이블존 상세 정보 대표 이미지 조회 오류 해결 #178
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,7 @@ public WaybleZoneDetailResponseDto getWaybleZoneDetail(Long waybleZoneId) { | |
| if (f == null) throw new ApplicationException(WaybleZoneErrorCase.WAYBLE_ZONE_FACILITY_NOT_FOUND); | ||
|
|
||
| var images = zone.getWaybleZoneImageList(); | ||
| String imageUrl = images.stream().findFirst().map(WaybleZoneImage::getImageUrl).orElse(null); | ||
| //String imageUrl = images.stream().findFirst().map(WaybleZoneImage::getImageUrl).orElse(null); | ||
| List<String> photoUrls = images.stream().map(WaybleZoneImage::getImageUrl).toList(); | ||
|
|
||
| Map<String, WaybleZoneDetailResponseDto.BusinessHourDto> businessHours = new LinkedHashMap<>(); | ||
|
|
@@ -94,7 +94,7 @@ public WaybleZoneDetailResponseDto getWaybleZoneDetail(Long waybleZoneId) { | |
| .rating(zone.getRating()) | ||
| .reviewCount(zone.getReviewCount()) | ||
| .contactNumber(zone.getContactNumber()) | ||
| .imageUrl(imageUrl) | ||
| .imageUrl(zone.getMainImageUrl()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain목록 API와 대표 이미지 기준의 일관성 점검 요청 상세는 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "[1] 목록/상세에서 대표 이미지 사용 위치 확인"
rg -n -C2 'getMainImageUrl\(|imageUrl\(' src/main/java/com/wayble/server/wayblezone | sed -n '1,200p'
echo
echo "[2] 추천/검색 응답 DTO에서 대표 이미지 필드 구성 확인"
rg -n -C2 'WaybleZone(Recommend|Search|List)ResponseDto|mainImageUrl' src/main/java | sed -n '1,200p'Length of output: 24783 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "===== WaybleZoneListResponseDto ====="
sed -n '1,200p' src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneListResponseDto.java
echo
echo "===== WaybleZoneDetailResponseDto ====="
sed -n '1,200p' src/main/java/com/wayble/server/wayblezone/dto/WaybleZoneDetailResponseDto.java
echo
echo "===== WaybleZoneRecommendResponseDto ====="
sed -n '1,200p' src/main/java/com/wayble/server/explore/dto/recommend/WaybleZoneRecommendResponseDto.java
echo
echo "===== WaybleZoneSearchResponseDto ====="
sed -n '1,200p' src/main/java/com/wayble/server/explore/dto/search/response/WaybleZoneSearchResponseDto.javaLength of output: 3465 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "===== WaybleZoneInfoResponseDto (공통 DTO) ====="
sed -n '1,200p' src/main/java/com/wayble/server/explore/dto/common/WaybleZoneInfoResponseDto.java
echo
echo "===== UserPlaceService에서 대표 이미지 사용 확인 ====="
rg -n -A5 -B5 'imageUrl.*mainImageUrl|mainImageUrl.*imageUrl' src/main/java/com/wayble/server/user/service/UserPlaceService.javaLength of output: 1760 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "===== UserPlaceService snippet ====="
sed -n '100,160p' src/main/java/com/wayble/server/user/service/UserPlaceService.javaLength of output: 2710 대표 이미지 기준 일관성 필요: 리스트 API에서도 현재 코드베이스를 확인한 결과, 대표 이미지 노출 기준이 엔드포인트별로 상이합니다.
사용자 경험(UX)의 일관성을 위해, 리스트 API( 수정 예시(diff): – .imageUrl(image != null ? image.getImageUrl() : null)
+ .imageUrl(zone.getMainImageUrl())
🤖 Prompt for AI Agents |
||
| .photos(photoUrls) | ||
| .facilities(FacilityDto.builder() | ||
| .hasSlope(f.isHasSlope()) | ||
|
|
||
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.
🛠️ Refactor suggestion
대표 이미지 null 폴백 및 photos와의 불일치 해소 필요
이번 수정으로 상세의 대표 이미지를
zone.getMainImageUrl()로 일관화한 점은 👍 입니다. 다만 기존 데이터에mainImageUrl이 비어 있는 경우 상세 화면의 대표 이미지가 사라질 수 있고, 대표 이미지가waybleZoneImageList에 포함되지 않은 경우 photos와 대표 이미지가 불일치할 수 있습니다. 아래처럼 폴백(첫 번째 이미지)과 photos에 대표 이미지 포함을 보장하는 처리를 제안합니다.아래 diff는 해당 구간만 교체합니다.
추가 import가 필요합니다(파일 상단 import 블록에 추가).
Also applies to: 97-97
🤖 Prompt for AI Agents