diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e08469a..77d85e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: CI / CD on: push: - branches: [feat/#85-logout] + branches: [main] jobs: CI: diff --git a/src/main/java/com/opendata/domain/tourspot/dto/response/TourSpotDetailResponse.java b/src/main/java/com/opendata/domain/tourspot/dto/response/TourSpotDetailResponse.java index 5861a5a..b614bb1 100644 --- a/src/main/java/com/opendata/domain/tourspot/dto/response/TourSpotDetailResponse.java +++ b/src/main/java/com/opendata/domain/tourspot/dto/response/TourSpotDetailResponse.java @@ -20,9 +20,11 @@ @NoArgsConstructor @AllArgsConstructor public class TourSpotDetailResponse { + private Long tourspotId; private String tourspotNm; private AddressDto address; private String congestionLabel; + private String imageUrl; private List tourSpotEvents; private List tourSpotTags; private List tourSpotMonthlyCongestionDtos; diff --git a/src/main/java/com/opendata/domain/tourspot/mapper/TourSpotDetailMapper.java b/src/main/java/com/opendata/domain/tourspot/mapper/TourSpotDetailMapper.java index cb34701..29bf331 100644 --- a/src/main/java/com/opendata/domain/tourspot/mapper/TourSpotDetailMapper.java +++ b/src/main/java/com/opendata/domain/tourspot/mapper/TourSpotDetailMapper.java @@ -25,6 +25,7 @@ public interface TourSpotDetailMapper { @Mapping(target = "tourspotNm", source = "tourSpot.tourspotNm") + @Mapping(target = "imageUrl", source = "imageUrl") @Mapping(target = "address", source = "address") @Mapping(target = "congestionLabel", source = "congestion") @Mapping(target = "tourSpotEvents", source = "events") @@ -32,6 +33,7 @@ public interface TourSpotDetailMapper { @Mapping(target = "tourSpotMonthlyCongestionDtos", source = "monthlyCongestions") TourSpotDetailResponse toResponse( TourSpot tourSpot, + String imageUrl, AddressDto address, String congestion, List events, diff --git a/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java b/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java index accc5a7..c2dc8dd 100644 --- a/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java +++ b/src/main/java/com/opendata/domain/tourspot/service/TourSpotService.java @@ -54,6 +54,7 @@ public class TourSpotService private final CustomTourSpotCombineRepository combineRepository; private final CurrentCongestionRepository currentCongestionRepository; private final FutureCongestionRepository futureCongestionRepository; + private final TourSpotImageRepository tourSpotImageRepository; private final AddressCache addressCache; @@ -75,7 +76,9 @@ public TourSpotDetailResponse combineTourSpotDetail(Long tourspotId) throws Json List tourSpotEvents = tourSpotEventRepository.findAllByTourSpot(tourSpot); List tourSpotTags = tourSpotTagRepository.findAllByTourSpot(tourSpot); List monthlyCongestions = monthlyCongestionRepository.findAllByTourspot(tourSpot); - + String imageUrl = tourSpotImageRepository.findByTourSpot(tourSpot) + .orElseThrow(() -> new GlobalException(ErrorStatus.TOURSPOT_NOT_FOUND)) + .getTourspotImgUrl(); String congestionLabel = null; if (tourSpotCurrentCongestion != null) { congestionLabel = tourSpotCurrentCongestion.getCongestionLvl().getCongestionLabel(); @@ -84,6 +87,7 @@ public TourSpotDetailResponse combineTourSpotDetail(Long tourspotId) throws Json return tourSpotDetailMapper.toResponse( tourSpot, + imageUrl, tourSpotDetailMapper.toAddressDto(address), congestionLabel, tourSpotDetailMapper.toEventDtos(tourSpotEvents),