diff --git a/BE/src/main/java/org/team4/airbnb/accommodation/Accommodation.java b/BE/src/main/java/org/team4/airbnb/accommodation/Accommodation.java index ccc29fb9b..4855bf005 100644 --- a/BE/src/main/java/org/team4/airbnb/accommodation/Accommodation.java +++ b/BE/src/main/java/org/team4/airbnb/accommodation/Accommodation.java @@ -55,4 +55,12 @@ public List getImageUrls() { public boolean isNotNullName(Accommodation accommodation) { return !accommodation.name.isEmpty(); } + + public Double getLongitude() { + return location.getPosition().getLon(); + } + + public Double getLatitude() { + return location.getPosition().getLat(); + } } diff --git a/BE/src/main/java/org/team4/airbnb/accommodation/dto/AccommodationSearchElement.java b/BE/src/main/java/org/team4/airbnb/accommodation/dto/AccommodationSearchElement.java index 95a7961a6..ac5e3d62e 100644 --- a/BE/src/main/java/org/team4/airbnb/accommodation/dto/AccommodationSearchElement.java +++ b/BE/src/main/java/org/team4/airbnb/accommodation/dto/AccommodationSearchElement.java @@ -32,8 +32,8 @@ public static AccommodationSearchElement from(Accommodation accommodation) { .id(accommodation.getId()) .name(accommodation.getName()) .price(accommodation.getPrice()) - .longitude(accommodation.getLocation().getPosition().getLon()) - .latitude(accommodation.getLocation().getPosition().getLat()) + .longitude(accommodation.getLongitude()) + .latitude(accommodation.getLatitude()) .address(accommodation.getAddress()) .type(accommodation.getType().getDbData()) .hostName(accommodation.getHostName())