Skip to content

Commit

Permalink
Change the rest format
Browse files Browse the repository at this point in the history
  • Loading branch information
sefadegirmenci committed Jul 14, 2022
1 parent 4e0f1e1 commit 0104daa
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -36,7 +37,7 @@ public ResponseEntity<Flight> addFlight(@RequestBody Flight flight){
/* TODO: Change the search logic*/
@Operation(summary = "Search a flight by departure and arrival airports")
@GetMapping(value = "search/{departureAirportCode}/{arrivalAirportCode}/{departureDateTime}/{arrivalDateTime}",produces = {"application/json"})
public ResponseEntity<List<Flight>> searchFlight(@PathVariable String departureAirportCode, @PathVariable String arrivalAirportCode, @PathVariable LocalDateTime departureDateTime, @PathVariable LocalDateTime arrivalDateTime) {
public ResponseEntity<List<Flight>> searchFlight(@PathVariable String departureAirportCode, @PathVariable String arrivalAirportCode, @PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDateTime departureDateTime, @PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDateTime arrivalDateTime) {
return ResponseEntity.ok(flightService.searchFlight(departureAirportCode, arrivalAirportCode, departureDateTime, arrivalDateTime));
}

Expand Down

0 comments on commit 0104daa

Please sign in to comment.