diff --git a/src/main/java/com/onna/onnaback/domain/place/adapter/out/persistence/PlacePersistenceAdapter.java b/src/main/java/com/onna/onnaback/domain/place/adapter/out/persistence/PlacePersistenceAdapter.java index e969222..0df31d1 100644 --- a/src/main/java/com/onna/onnaback/domain/place/adapter/out/persistence/PlacePersistenceAdapter.java +++ b/src/main/java/com/onna/onnaback/domain/place/adapter/out/persistence/PlacePersistenceAdapter.java @@ -1,5 +1,6 @@ package com.onna.onnaback.domain.place.adapter.out.persistence; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -88,16 +89,16 @@ private Long calculateSparkCount(Place place, SparkType sparkType, Long sparkCnt = (long) place.getSparkList().size(); for (Spark spark : sparks) { - if (sparkType != null && spark.getType() != sparkType) { + // 스파크 날짜가 이전이면 카운트 x + if (spark.getSparkDate().isBefore(LocalDateTime.now())) { sparkCnt--; - continue; - } - if (durationHour != null && spark.getDurationHour() != durationHour) { + } else if (sparkType != null && spark.getType() != sparkType) { + sparkCnt--; + } else if (durationHour != null && spark.getDurationHour() != durationHour) { sparkCnt--; - continue; } - // 모집중 - if (sortType == SortType.RECRUITING && spark.getRecruitType() != RecruitType.RECRUITING) { + // 모집중 아닌 경우 + else if (sortType == SortType.RECRUITING && spark.getRecruitType() != RecruitType.RECRUITING) { sparkCnt--; } } diff --git a/src/main/java/com/onna/onnaback/domain/spark/adapter/out/persistence/SparkPersistenceAdapter.java b/src/main/java/com/onna/onnaback/domain/spark/adapter/out/persistence/SparkPersistenceAdapter.java index 31993ea..b1058ea 100644 --- a/src/main/java/com/onna/onnaback/domain/spark/adapter/out/persistence/SparkPersistenceAdapter.java +++ b/src/main/java/com/onna/onnaback/domain/spark/adapter/out/persistence/SparkPersistenceAdapter.java @@ -54,7 +54,6 @@ public Spark getById(Long sparkId) { public List getSparkListByPlaceId(Long placeId) { return sparkRepository.findSparksByPlace(placeId) .stream().map(spark -> SparkResponse.builder().sparkId(spark.getSparkId()) - .img(spark.getImg()) .title(spark.getTitle()) .durationHour(spark.getDurationHour())