Skip to content

Commit 192da0f

Browse files
committed
[refactor] aiSummary가 없는 뉴스는 조회 목록에서 제거
1 parent 010da1c commit 192da0f

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/Konkuk/U2E/domain/news/service/NewsLatelyService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class NewsLatelyService {
1717
//news의 최신 뉴스 5개를 가져오는 서비스
1818
public GetLatelyNewsResponse getLatelyNews() {
1919
return GetLatelyNewsResponse.of(newsRepository.findTop5ByOrderByNewsDateDesc().stream()
20+
.filter(news -> news.getAiSummary() != null)
2021
.map(newsMapperFactory.newsMappingFunction())
2122
.map(LatelyNews::of)
2223
.toList()

src/main/java/Konkuk/U2E/domain/pin/service/PinListService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ private List<PinInfo> getPinListByRegion(String regionName) {
7575

7676
private List<PinInfo> getPinListByClimate(ClimateProblem climateProblem) {
7777
return climateRepository.findNewsByClimateProblem(climateProblem).stream()
78+
.filter(news -> news.getAiSummary() != null)
7879
.map(newsPinRepository::findPinsByNews)
7980
.flatMap(pinList -> pinList.stream()
8081
.map(pin -> this.createPinInfo(pin, climateProblem))

0 commit comments

Comments
 (0)