diff --git a/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivitySummaryResponse.java b/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivitySummaryResponse.java index bd741e59..ceaaf863 100644 --- a/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivitySummaryResponse.java +++ b/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivitySummaryResponse.java @@ -6,6 +6,7 @@ @Builder public record ActivitySummaryResponse( String spotName, - TotalIndex totalIndex + TotalIndex totalIndex, + Long spotId ) { } diff --git a/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivityWeatherResponse.java b/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivityWeatherResponse.java index 8b598ec9..0429d478 100644 --- a/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivityWeatherResponse.java +++ b/src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivityWeatherResponse.java @@ -4,6 +4,7 @@ public record ActivityWeatherResponse( String location, String windSpeed, String waveHeight, - String waterTemp + String waterTemp, + Long spotId ) { } diff --git a/src/main/java/sevenstar/marineleisure/activity/service/ActivityService.java b/src/main/java/sevenstar/marineleisure/activity/service/ActivityService.java index bb03ad14..97bdc229 100644 --- a/src/main/java/sevenstar/marineleisure/activity/service/ActivityService.java +++ b/src/main/java/sevenstar/marineleisure/activity/service/ActivityService.java @@ -61,12 +61,16 @@ private Map getLocalActivitySummary(BigDecimal SpotPreviewReadResponse preview = spotService.preview(latitude.floatValue(), longitude.floatValue()); responses.put("Fishing", - new ActivitySummaryResponse(preview.fishing().getName(), preview.fishing().getTotalIndex())); + new ActivitySummaryResponse(preview.fishing().getName(), preview.fishing().getTotalIndex(),preview.fishing() + .getSpotId())); responses.put("Mudflat", - new ActivitySummaryResponse(preview.mudflat().getName(), preview.mudflat().getTotalIndex())); + new ActivitySummaryResponse(preview.mudflat().getName(), preview.mudflat().getTotalIndex(),preview.mudflat() + .getSpotId())); responses.put("Surfing", - new ActivitySummaryResponse(preview.surfing().getName(), preview.surfing().getTotalIndex())); - responses.put("Scuba", new ActivitySummaryResponse(preview.scuba().getName(), preview.scuba().getTotalIndex())); + new ActivitySummaryResponse(preview.surfing().getName(), preview.surfing().getTotalIndex(),preview.surfing() + .getSpotId())); + responses.put("Scuba", new ActivitySummaryResponse(preview.scuba().getName(), preview.scuba().getTotalIndex(),preview.scuba() + .getSpotId())); // Fishing fishingBySpot = null; // Mudflat mudflatBySpot = null; @@ -151,25 +155,25 @@ private Map getGlobalActivitySummary() { if (fishingResult.isPresent()) { Fishing fishing = fishingResult.get(); OutdoorSpot spot = outdoorSpotRepository.findById(fishing.getSpotId()).get(); - responses.put("Fishing", new ActivitySummaryResponse(spot.getName(), fishing.getTotalIndex())); + responses.put("Fishing", new ActivitySummaryResponse(spot.getName(), fishing.getTotalIndex(),fishing.getSpotId())); } if (mudflatResult.isPresent()) { Mudflat mudflat = mudflatResult.get(); OutdoorSpot spot = outdoorSpotRepository.findById(mudflat.getSpotId()).get(); - responses.put("Mudflat", new ActivitySummaryResponse(spot.getName(), mudflat.getTotalIndex())); + responses.put("Mudflat", new ActivitySummaryResponse(spot.getName(), mudflat.getTotalIndex(),mudflat.getSpotId())); } if (scubaResult.isPresent()) { Scuba scuba = scubaResult.get(); OutdoorSpot spot = outdoorSpotRepository.findById(scuba.getSpotId()).get(); - responses.put("Scuba", new ActivitySummaryResponse(spot.getName(), scuba.getTotalIndex())); + responses.put("Scuba", new ActivitySummaryResponse(spot.getName(), scuba.getTotalIndex(),scuba.getSpotId())); } if (surfingResult.isPresent()) { Surfing surfing = surfingResult.get(); OutdoorSpot spot = outdoorSpotRepository.findById(surfing.getSpotId()).get(); - responses.put("Surfing", new ActivitySummaryResponse(spot.getName(), surfing.getTotalIndex())); + responses.put("Surfing", new ActivitySummaryResponse(spot.getName(), surfing.getTotalIndex(),surfing.getSpotId())); } return responses; @@ -234,7 +238,8 @@ public ActivityWeatherResponse getWeatherBySpot(Float latitude, Float longitude) nearSpot.getName(), fishing.getWindSpeedMax().toString(), fishing.getWaveHeightMax().toString(), - fishing.getSeaTempMax().toString() + fishing.getSeaTempMax().toString(), + nearSpot.getId() ); } diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 4c350077..024cc445 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -26,7 +26,7 @@ spring: show_sql: true dialect: org.hibernate.dialect.MySQL8Dialect hibernate: - ddl-auto: none + ddl-auto: update defer-datasource-initialization: true ai: @@ -36,7 +36,7 @@ spring: model: gpt-3.5-turbo flyway: - enabled: true + enabled: false baseline-on-migrate: true # locations: classpath:db/migration