Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI / CD

on:
push:
branches: [feat/#85-logout]
branches: [main]

jobs:
CI:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TourSpotEventDto> tourSpotEvents;
private List<TourSpotTagDto> tourSpotTags;
private List<TourSpotMonthlyCongestionDto> tourSpotMonthlyCongestionDtos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
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")
@Mapping(target = "tourSpotTags", source = "tags")
@Mapping(target = "tourSpotMonthlyCongestionDtos", source = "monthlyCongestions")
TourSpotDetailResponse toResponse(
TourSpot tourSpot,
String imageUrl,
AddressDto address,
String congestion,
List<TourSpotEventDto> events,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -75,7 +76,9 @@ public TourSpotDetailResponse combineTourSpotDetail(Long tourspotId) throws Json
List<TourSpotEvent> tourSpotEvents = tourSpotEventRepository.findAllByTourSpot(tourSpot);
List<TourSpotTag> tourSpotTags = tourSpotTagRepository.findAllByTourSpot(tourSpot);
List<TourSpotMonthlyCongestion> 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();
Expand All @@ -84,6 +87,7 @@ public TourSpotDetailResponse combineTourSpotDetail(Long tourspotId) throws Json

return tourSpotDetailMapper.toResponse(
tourSpot,
imageUrl,
tourSpotDetailMapper.toAddressDto(address),
congestionLabel,
tourSpotDetailMapper.toEventDtos(tourSpotEvents),
Expand Down