Skip to content

Commit

Permalink
♻️ 최단 경로 API에서 불필요한 응답값 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
tinajeong committed Oct 28, 2024
1 parent 71a1d23 commit 1c6016c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.moneygement.lyf.jarvis.route.domain.OptimalRouteRequest;
import com.moneygement.lyf.jarvis.route.domain.OptimalRouteResponse;
import com.moneygement.lyf.jarvis.route.domain.OptimalRouteUserResponse;
import com.moneygement.lyf.jarvis.route.service.RouteService;

import io.swagger.v3.oas.annotations.Operation;
Expand All @@ -29,9 +30,9 @@ public class RouteController {

@PostMapping("")
@Operation(summary = "최단 경로 정보 제공", description = "좌표와 교통수단 기준의 최단 경로 정보를 제공합니다.")
public ResponseEntity<OptimalRouteResponse> getOptimalRouteRequest(@RequestBody OptimalRouteRequest optimalRouteRequest)
public ResponseEntity<OptimalRouteUserResponse> getOptimalRouteRequest(@RequestBody OptimalRouteRequest optimalRouteRequest)
throws IOException {
OptimalRouteResponse optimalRoute = routeService.getOptimalRoute(optimalRouteRequest);
return ResponseEntity.ok(optimalRoute);
return ResponseEntity.ok(new OptimalRouteUserResponse(optimalRoute.getPaths().get(0).getPoints().getCoordinates()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.moneygement.lyf.jarvis.route.domain;

import java.util.List;

public record OptimalRouteUserResponse(List<List<Double>> coordinates) {
}

0 comments on commit 1c6016c

Please sign in to comment.