Skip to content

Commit

Permalink
fix: photobooth brand list parameter 로 변환
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Oct 8, 2024
1 parent 770bbe1 commit 5f7aeec
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public interface PhotoBoothFindPort {

PhotoBoothFindResponseDto findById(Long id);

List<NearPhotoBoothInfo> getPhotoboothWithin2Km(double currentLat, double currentLon, PhotoBoothBrand brand);
List<NearPhotoBoothInfo> getPhotoboothWithin2Km(double currentLat, double currentLon, List<PhotoBoothBrand> brand);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public PhotoBoothFindResponseDto findPhotoBoothResponse(Long id) {
return photoBoothFindPort.findById(id);
}

public List<NearPhotoBoothInfo> findNearPhotoBooth(double lat, double lon, PhotoBoothBrand brand) {
public List<NearPhotoBoothInfo> findNearPhotoBooth(double lat, double lon, List<PhotoBoothBrand> brand) {
return photoBoothFindPort.getPhotoboothWithin2Km(lat, lon, brand);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public interface PhotoBoothFindUseCase {

PhotoBoothFindResponseDto findPhotoBoothResponse(Long id);

List<NearPhotoBoothInfo> findNearPhotoBooth(double lat, double lon, PhotoBoothBrand brand);
List<NearPhotoBoothInfo> findNearPhotoBooth(double lat, double lon, List<PhotoBoothBrand> brand);

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ApplicationResponse<PhotoBoothFindResponseDto> getPhotoBoothById(@PathVar
public ApplicationResponse<List<NearPhotoBoothInfo>> getAllPhotoBooth(
@RequestParam("lat") double lat,
@RequestParam("lon") double lon,
@RequestParam(value = "brand", required = false) PhotoBoothBrand brand
@RequestParam(value = "brand", required = false) List<PhotoBoothBrand> brand
) {

List<NearPhotoBoothInfo> responses = photoBoothFindUseCase.findNearPhotoBooth(lat, lon, brand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public PhotoBoothFindResponseDto findById(Long id) {
);
}

public List<NearPhotoBoothInfo> getPhotoboothWithin2Km(double currentLat, double currentLon, PhotoBoothBrand brand) {
public List<NearPhotoBoothInfo> getPhotoboothWithin2Km(double currentLat, double currentLon, List<PhotoBoothBrand> brands) {

// 모든 포토부스 데이터를 가져옵니다.
List<JpaPhotoBooth> allPhotobooths;

if (brand != null) {
// 지정된 브랜드로 포토부스를 필터링하여 조회
allPhotobooths = photoBoothRepository.findByPhotoBoothPhotoBoothBrand(brand);
if (brands != null && !brands.isEmpty()) {
// 지정된 브랜드 목록으로 포토부스를 필터링하여 조회
allPhotobooths = photoBoothRepository.findByPhotoBoothPhotoBoothBrandIn(brands);
} else {
// 브랜드 필터링 없이 모든 포토부스 조회
allPhotobooths = photoBoothRepository.findAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

public interface PhotoBoothRepository extends JpaRepository<JpaPhotoBooth, Long> {

List<JpaPhotoBooth> findByPhotoBoothPhotoBoothBrand(PhotoBoothBrand photoBoothBrand);
List<JpaPhotoBooth> findByPhotoBoothPhotoBoothBrandIn(List<PhotoBoothBrand> brands);
}

0 comments on commit 5f7aeec

Please sign in to comment.