33import com .back .web7_9_codecrete_be .domain .location .dto .response .KakaoLocalResponse ;
44import com .back .web7_9_codecrete_be .domain .location .dto .response .KakaoMobilityResponse ;
55import com .back .web7_9_codecrete_be .domain .location .service .KakaoLocalService ;
6+ import com .back .web7_9_codecrete_be .global .error .code .LocationErrorCode ;
7+ import com .back .web7_9_codecrete_be .global .error .exception .BusinessException ;
68import com .back .web7_9_codecrete_be .global .rsData .RsData ;
79import io .swagger .v3 .oas .annotations .Operation ;
810import io .swagger .v3 .oas .annotations .Parameter ;
@@ -95,7 +97,7 @@ public List<KakaoMobilityResponse.Guide> navigateGuides(
9597 .toList ();
9698 }
9799 @ GetMapping ("/navigate/summary" )
98- public List < KakaoMobilityResponse .Guide > navigateSummary (
100+ public KakaoMobilityResponse .Summary navigateSummary (
99101 @ RequestParam double startX ,
100102 @ RequestParam double startY ,
101103 @ RequestParam double endX ,
@@ -104,18 +106,16 @@ public List<KakaoMobilityResponse.Guide> navigateSummary(
104106 KakaoMobilityResponse res = kakaoLocalService .NaviSearchSummary (startX , startY , endX , endY );
105107
106108 if (res == null || res .getRoutes () == null || res .getRoutes ().isEmpty ()) {
107- return List . of ( );
109+ throw new BusinessException ( LocationErrorCode . ROUTE_NOT_FOUND );
108110 }
109111
110112 KakaoMobilityResponse .Route route0 = res .getRoutes ().get (0 );
111- if (route0 .getSections () == null || route0 . getSections (). isEmpty () ) {
112- return List . of ( );
113+ if (route0 .getSummary () == null ) {
114+ throw new BusinessException ( LocationErrorCode . ROUTE_NOT_FOUND );
113115 }
114116
115- return route0 .getSections ().stream ()
116- .filter (section -> section .getGuides () != null && !section .getGuides ().isEmpty ())
117- .flatMap (section -> section .getGuides ().stream ())
118- .toList ();
117+ return route0 .getSummary ();
118+
119119 }
120120}
121121
0 commit comments