From 2c7f650db84ba45a2b713388c0329af8450096f0 Mon Sep 17 00:00:00 2001 From: anstjgus922 Date: Tue, 30 Jul 2024 14:43:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B0=98=ED=99=98=20=EA=B0=92=EC=97=90?= =?UTF-8?q?=20=EC=82=AC=EC=A7=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../midpoint_backend/domain/places/MapService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/solucitation/midpoint_backend/domain/places/MapService.java b/src/main/java/com/solucitation/midpoint_backend/domain/places/MapService.java index 0ebc9dc..ca0878f 100644 --- a/src/main/java/com/solucitation/midpoint_backend/domain/places/MapService.java +++ b/src/main/java/com/solucitation/midpoint_backend/domain/places/MapService.java @@ -69,6 +69,13 @@ public List> findPlaces(double latitude, double longitude, i place.put("types", resultNode.path("types").toString()); place.put("placeID", resultNode.path("place_id").asText()); + JsonNode photosNode = resultNode.path("photos"); + if (photosNode.isArray() && photosNode.size() > 0) { + place.put("photo", photosNode.get(0).path("photo_reference").asText()); + } else { + place.put("photo", null); + } + places.add(place); }