From c855efeaa1bb389c2c57ecc435155a9cc440b678 Mon Sep 17 00:00:00 2001 From: SeongHoon Jeong Date: Thu, 14 Dec 2023 17:18:34 +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=20v1=20?= =?UTF-8?q?=EC=BF=BC=EB=A6=AC=20=EC=A0=84=EB=9E=B5=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../briefing/briefing/application/BriefingQueryService.java | 4 ---- .../application/strategy/BriefingV1QueryStrategy.java | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/briefing/briefing/application/BriefingQueryService.java b/src/main/java/briefing/briefing/application/BriefingQueryService.java index 7846f8c..1679355 100644 --- a/src/main/java/briefing/briefing/application/BriefingQueryService.java +++ b/src/main/java/briefing/briefing/application/BriefingQueryService.java @@ -3,11 +3,7 @@ import briefing.briefing.application.context.BriefingQueryContext; import briefing.briefing.application.context.BriefingQueryContextFactory; import briefing.briefing.application.dto.BriefingRequestParam; -import briefing.briefing.application.strategy.BriefingV1QueryStrategy; import briefing.briefing.domain.Briefing; -import briefing.briefing.domain.repository.BriefingRepository; -import java.time.LocalDateTime; -import java.time.LocalTime; import java.util.List; import briefing.common.enums.APIVersion; diff --git a/src/main/java/briefing/briefing/application/strategy/BriefingV1QueryStrategy.java b/src/main/java/briefing/briefing/application/strategy/BriefingV1QueryStrategy.java index 5d9c071..283feac 100644 --- a/src/main/java/briefing/briefing/application/strategy/BriefingV1QueryStrategy.java +++ b/src/main/java/briefing/briefing/application/strategy/BriefingV1QueryStrategy.java @@ -2,6 +2,7 @@ import briefing.briefing.application.dto.BriefingRequestParam; import briefing.briefing.domain.Briefing; +import briefing.briefing.domain.BriefingType; import briefing.briefing.domain.repository.BriefingRepository; import lombok.RequiredArgsConstructor; @@ -20,8 +21,9 @@ public List findBriefings(BriefingRequestParam.BriefingPreviewListPara final LocalDateTime startDateTime = params.getDate().atStartOfDay(); final LocalDateTime endDateTime = params.getDate().atTime(LocalTime.MAX); - return briefingRepository.findAllByTypeAndCreatedAtBetweenOrderByRanks( - params.getType(), startDateTime, endDateTime); + List briefingList = briefingRepository.findAllByTypeAndCreatedAtBetweenOrderByRanks(params.getType(), startDateTime, endDateTime); + if(briefingList.isEmpty()) return briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(BriefingType.SOCIAL); + return briefingList; } @Override