From e68c055d8975cf39929e633de767c12820bcbb90 Mon Sep 17 00:00:00 2001 From: swa07016 Date: Wed, 27 Dec 2023 10:20:48 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Feat:=20=EB=B8=8C=EB=A6=AC?= =?UTF-8?q?=ED=95=91=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20V2=20?= =?UTF-8?q?=EB=B0=A9=EC=96=B4=EC=A0=81=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/strategy/BriefingV2QueryStrategy.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/briefing/briefing/application/strategy/BriefingV2QueryStrategy.java b/src/main/java/briefing/briefing/application/strategy/BriefingV2QueryStrategy.java index b48a684..1f44edc 100644 --- a/src/main/java/briefing/briefing/application/strategy/BriefingV2QueryStrategy.java +++ b/src/main/java/briefing/briefing/application/strategy/BriefingV2QueryStrategy.java @@ -9,6 +9,7 @@ import java.time.LocalDateTime; import java.time.LocalTime; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -21,15 +22,17 @@ public class BriefingV2QueryStrategy implements BriefingQueryStrategy{ @Override public List findBriefings(BriefingRequestParam.BriefingPreviewListParam params) { + List briefingList; if(params.isPresentDate()) { final LocalDateTime startDateTime = params.getDate().atStartOfDay(); final LocalDateTime endDateTime = params.getDate().atTime(LocalTime.MAX); - return briefingRepository.findBriefingsWithScrapCount( + briefingList = briefingRepository.findBriefingsWithScrapCount( params.getType(), startDateTime, endDateTime, params.getTimeOfDay()); + if(!briefingList.isEmpty()) return briefingList; } - List briefingList = briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(params.getType()); + briefingList = briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(params.getType()); Collections.reverse(briefingList); return briefingList; }