From 74dc050a5c4b6b3382ba501cc743b6255780609f Mon Sep 17 00:00:00 2001 From: Kirollbas Date: Mon, 14 Aug 2023 13:23:02 +0300 Subject: [PATCH] fix: renamed method in CarWashRepository due map position. --- .../java/com/pomika/carwashbackend/model/MapPosition.java | 2 +- .../pomika/carwashbackend/repository/CarWashRepository.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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,