adding get all waypoints

This commit is contained in:
2023-05-01 15:28:53 +02:00
parent d5ce8c74f0
commit faa7692126

View File

@@ -19,6 +19,12 @@ public class WaypointController {
this.waypointService = waypointService; this.waypointService = waypointService;
} }
@GetMapping("")
public ResponseEntity<List<WaypointsEntity>> getAllWaypoints() {
List<WaypointsEntity> waypoint = waypointService.getAllWaypoints();
return new ResponseEntity<>(waypoint, HttpStatus.OK);
}
@GetMapping("/{location}") @GetMapping("/{location}")
public ResponseEntity<List<WaypointsEntity>> getAllWaypoints(@PathVariable("location") String location) { public ResponseEntity<List<WaypointsEntity>> getAllWaypoints(@PathVariable("location") String location) {
System.out.println(waypointService.getAllWaypointsByLocation(location)); System.out.println(waypointService.getAllWaypointsByLocation(location));