From 5f7aeeceeb60576ce4695ddfad9a2ff087386fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=EC=A0=95=ED=9B=84?= Date: Tue, 8 Oct 2024 12:40:54 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20photobooth=20brand=20list=20parameter=20?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pocket/domain/port/photobooth/PhotoBoothFindPort.java | 2 +- .../domain/service/photobooth/PhotoBoothFindService.java | 2 +- .../domain/usecase/photobooth/PhotoBoothFindUseCase.java | 2 +- .../photobooth/presentation/PhotoBoothController.java | 2 +- .../adapter/photobooth/adpater/PhotoBoothFindAdapter.java | 8 ++++---- .../pocket/outbound/repository/PhotoBoothRepository.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/domain/src/main/java/com/pocket/domain/port/photobooth/PhotoBoothFindPort.java b/domain/src/main/java/com/pocket/domain/port/photobooth/PhotoBoothFindPort.java index 82a4e9a..5c79243 100644 --- a/domain/src/main/java/com/pocket/domain/port/photobooth/PhotoBoothFindPort.java +++ b/domain/src/main/java/com/pocket/domain/port/photobooth/PhotoBoothFindPort.java @@ -10,6 +10,6 @@ public interface PhotoBoothFindPort { PhotoBoothFindResponseDto findById(Long id); - List getPhotoboothWithin2Km(double currentLat, double currentLon, PhotoBoothBrand brand); + List getPhotoboothWithin2Km(double currentLat, double currentLon, List brand); } diff --git a/domain/src/main/java/com/pocket/domain/service/photobooth/PhotoBoothFindService.java b/domain/src/main/java/com/pocket/domain/service/photobooth/PhotoBoothFindService.java index 6d18281..4b96f80 100644 --- a/domain/src/main/java/com/pocket/domain/service/photobooth/PhotoBoothFindService.java +++ b/domain/src/main/java/com/pocket/domain/service/photobooth/PhotoBoothFindService.java @@ -21,7 +21,7 @@ public PhotoBoothFindResponseDto findPhotoBoothResponse(Long id) { return photoBoothFindPort.findById(id); } - public List findNearPhotoBooth(double lat, double lon, PhotoBoothBrand brand) { + public List findNearPhotoBooth(double lat, double lon, List brand) { return photoBoothFindPort.getPhotoboothWithin2Km(lat, lon, brand); } } diff --git a/domain/src/main/java/com/pocket/domain/usecase/photobooth/PhotoBoothFindUseCase.java b/domain/src/main/java/com/pocket/domain/usecase/photobooth/PhotoBoothFindUseCase.java index 053d5ad..eb067c9 100644 --- a/domain/src/main/java/com/pocket/domain/usecase/photobooth/PhotoBoothFindUseCase.java +++ b/domain/src/main/java/com/pocket/domain/usecase/photobooth/PhotoBoothFindUseCase.java @@ -10,6 +10,6 @@ public interface PhotoBoothFindUseCase { PhotoBoothFindResponseDto findPhotoBoothResponse(Long id); - List findNearPhotoBooth(double lat, double lon, PhotoBoothBrand brand); + List findNearPhotoBooth(double lat, double lon, List brand); } diff --git a/inbounds/src/main/java/com/pocket/inbounds/photobooth/presentation/PhotoBoothController.java b/inbounds/src/main/java/com/pocket/inbounds/photobooth/presentation/PhotoBoothController.java index b4a66e1..46d44ed 100644 --- a/inbounds/src/main/java/com/pocket/inbounds/photobooth/presentation/PhotoBoothController.java +++ b/inbounds/src/main/java/com/pocket/inbounds/photobooth/presentation/PhotoBoothController.java @@ -28,7 +28,7 @@ public ApplicationResponse getPhotoBoothById(@PathVar public ApplicationResponse> getAllPhotoBooth( @RequestParam("lat") double lat, @RequestParam("lon") double lon, - @RequestParam(value = "brand", required = false) PhotoBoothBrand brand + @RequestParam(value = "brand", required = false) List brand ) { List responses = photoBoothFindUseCase.findNearPhotoBooth(lat, lon, brand); diff --git a/outbound/src/main/java/com/pocket/outbound/adapter/photobooth/adpater/PhotoBoothFindAdapter.java b/outbound/src/main/java/com/pocket/outbound/adapter/photobooth/adpater/PhotoBoothFindAdapter.java index 7875eae..4d4a369 100644 --- a/outbound/src/main/java/com/pocket/outbound/adapter/photobooth/adpater/PhotoBoothFindAdapter.java +++ b/outbound/src/main/java/com/pocket/outbound/adapter/photobooth/adpater/PhotoBoothFindAdapter.java @@ -35,14 +35,14 @@ public PhotoBoothFindResponseDto findById(Long id) { ); } - public List getPhotoboothWithin2Km(double currentLat, double currentLon, PhotoBoothBrand brand) { + public List getPhotoboothWithin2Km(double currentLat, double currentLon, List brands) { // 모든 포토부스 데이터를 가져옵니다. List allPhotobooths; - if (brand != null) { - // 지정된 브랜드로 포토부스를 필터링하여 조회 - allPhotobooths = photoBoothRepository.findByPhotoBoothPhotoBoothBrand(brand); + if (brands != null && !brands.isEmpty()) { + // 지정된 브랜드 목록으로 포토부스를 필터링하여 조회 + allPhotobooths = photoBoothRepository.findByPhotoBoothPhotoBoothBrandIn(brands); } else { // 브랜드 필터링 없이 모든 포토부스 조회 allPhotobooths = photoBoothRepository.findAll(); diff --git a/outbound/src/main/java/com/pocket/outbound/repository/PhotoBoothRepository.java b/outbound/src/main/java/com/pocket/outbound/repository/PhotoBoothRepository.java index b3946cb..497f18a 100644 --- a/outbound/src/main/java/com/pocket/outbound/repository/PhotoBoothRepository.java +++ b/outbound/src/main/java/com/pocket/outbound/repository/PhotoBoothRepository.java @@ -8,5 +8,5 @@ public interface PhotoBoothRepository extends JpaRepository { - List findByPhotoBoothPhotoBoothBrand(PhotoBoothBrand photoBoothBrand); + List findByPhotoBoothPhotoBoothBrandIn(List brands); }