Class RouteRestController

java.lang.Object
com.endurancetrio.app.tracker.api.RouteRestController
All Implemented Interfaces:
RouteAPI

@EnduranceTrioRestController @RequestMapping("/api/tracker/v1") public class RouteRestController extends Object implements RouteAPI
  • Constructor Details

    • RouteRestController

      public RouteRestController(RouteService routeService)
  • Method Details

    • findAll

      @ResponseStatus(OK) @GetMapping(value="/routes", produces="application/json") public org.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<List<RouteDTO>>> findAll()
      Description copied from interface: RouteAPI
      Retrieves all route configurations.
      Specified by:
      findAll in interface RouteAPI
      Returns:
      a ResponseEntity containing an EnduranceTrioResponse with a list of RouteDTO representing all route configurations
    • create

      @ResponseStatus(CREATED) @PostMapping(value="/routes", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<RouteDTO>> create(@Valid @RequestBody @Valid RouteDTO routeDTO)
      Description copied from interface: RouteAPI
      Creates a new route configuration. The request body must not include an id — it is assigned by the server.
      Specified by:
      create in interface RouteAPI
      Parameters:
      routeDTO - the route configuration to be created (id must be null)
      Returns:
      a ResponseEntity containing an EnduranceTrioResponse with the created RouteDTO
    • update

      @ResponseStatus(OK) @PutMapping(value="/routes/{id}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<@NonNull EnduranceTrioResponse<RouteDTO>> update(@PathVariable @NonNull Long id, @Valid @RequestBody @Valid RouteDTO routeDTO)
      Description copied from interface: RouteAPI
      Updates an existing route configuration.
      Specified by:
      update in interface RouteAPI
      Parameters:
      id - the unique identifier of the route configuration to update
      routeDTO - the route configuration with updated data
      Returns:
      a ResponseEntity containing an EnduranceTrioResponse with the updated RouteDTO
    • findById

      @ResponseStatus(OK) @GetMapping(value="/routes/{id}", produces="application/json") public org.springframework.http.ResponseEntity<EnduranceTrioResponse<RouteDTO>> findById(@PathVariable @NonNull Long id)
      Description copied from interface: RouteAPI
      Finds a route configuration by its unique identifier.
      Specified by:
      findById in interface RouteAPI
      Parameters:
      id - the unique identifier of the route configuration
      Returns:
      a ResponseEntity containing an EnduranceTrioResponse with the corresponding RouteDTO
    • getRouteMetrics

      @ResponseStatus(OK) @GetMapping(value="/routes/{id}/metrics", produces="application/json") public org.springframework.http.ResponseEntity<EnduranceTrioResponse<RouteMetricsDTO>> getRouteMetrics(@PathVariable @NonNull Long id)
      Description copied from interface: RouteAPI
      Retrieves the GeoJSON CollectionFeature definition for a specific route.
      Specified by:
      getRouteMetrics in interface RouteAPI
      Parameters:
      id - The unique identifier of the route.
      Returns:
      a ResponseEntity containing an EnduranceTrioResponse with the corresponding RouteMetricsDTO