99import kb_hack .backend .domain .home .dto .request .RecentFestivalDTO ;
1010import kb_hack .backend .domain .home .dto .response .HomeResponse ;
1111import kb_hack .backend .domain .home .mapper .HomeMapper ;
12+ import kb_hack .backend .domain .notice .dto .response .NoticeDTO ;
1213import kb_hack .backend .global .common .exception .enums .BadStatusCode ;
1314import kb_hack .backend .global .common .exception .type .ServerErrorException ;
1415import lombok .RequiredArgsConstructor ;
@@ -31,6 +32,7 @@ public HomeResponse getHomeData(){
3132 List <RecentFestivalDTO > recentFestival ;
3233 List <RecentArticleDTO > recentArticle ;
3334 List <AnnounceRankingDTO > announceRanking ;
35+ List <NoticeDTO > notice ;
3436
3537 try {
3638 recentAnnounce = homeMapper .getRecentAnnounce ();
@@ -56,7 +58,13 @@ public HomeResponse getHomeData(){
5658 throw new ServerErrorException (BadStatusCode .FAIL_TO_GET_RECENT_ARTICLE_EXCEPTION );
5759 }
5860
61+ try {
62+ notice = homeMapper .getNotice ();
63+ } catch (Exception e ) {
64+ throw new ServerErrorException (BadStatusCode .FAIL_TO_GET_RECENT_NOTICE_EXCEPTION );
65+ }
66+
5967 List <RecentViewAnnounceDTO > recentAnnounceList = recentAnnounceService .getRecentAnnounceList ();
60- return new HomeResponse (announceRanking ,recentAnnounce ,recentFestival ,recentArticle ,recentAnnounceList );
68+ return new HomeResponse (announceRanking ,recentAnnounce ,recentFestival ,recentArticle ,recentAnnounceList , notice );
6169 }
6270}
0 commit comments