diff --git a/src/main/java/com/pomika/carwashbackend/model/MapPosition.java b/src/main/java/com/pomika/carwashbackend/model/MapPosition.java index 7fa21b8..bff00a1 100644 --- a/src/main/java/com/pomika/carwashbackend/model/MapPosition.java +++ b/src/main/java/com/pomika/carwashbackend/model/MapPosition.java @@ -10,7 +10,7 @@ @AllArgsConstructor @Embeddable public class MapPosition { - public MapPosition(){}; + public MapPosition(){} private double latitude; private double longitude; diff --git a/src/main/java/com/pomika/carwashbackend/repository/CarWashRepository.java b/src/main/java/com/pomika/carwashbackend/repository/CarWashRepository.java index 32d5517..5da30a7 100644 --- a/src/main/java/com/pomika/carwashbackend/repository/CarWashRepository.java +++ b/src/main/java/com/pomika/carwashbackend/repository/CarWashRepository.java @@ -11,7 +11,7 @@ public interface CarWashRepository extends JpaRepository { CarWash findByAccount(Account account); - List findByLatitudeIsBetweenAndLongitudeIsBetween(double latitudeBottom, + List findByMapPosition_LatitudeIsBetweenAndMapPosition_LongitudeIsBetween(double latitudeBottom, double latitudeTop, double longitudeBottom, double longitudeTop); @@ -19,7 +19,7 @@ List findByLatitudeIsBetweenAndLongitudeIsBetween(double latitudeBottom default List findCarWashesInSquare(double centerLatitude, double centerLongitude, double radius){ double latitudeShift = (180 * radius)/(Math.PI * 6378100); double longitudeShift = (180 * radius)/(Math.PI * 6356800); - return findByLatitudeIsBetweenAndLongitudeIsBetween( + return findByMapPosition_LatitudeIsBetweenAndMapPosition_LongitudeIsBetween( centerLatitude - latitudeShift, centerLatitude + latitudeShift, centerLongitude - longitudeShift,