Skip to content

Commit

Permalink
event controller updated with summary and description
Browse files Browse the repository at this point in the history
  • Loading branch information
imertetsu committed Aug 13, 2024
1 parent ced7177 commit a52c466
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/spacecraft/controllers/EventController.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.spacecraft.dtos.EventDTO;
import com.spacecraft.services.EventService;
import com.spacecraft.services.PositionService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -24,6 +25,7 @@ public EventController(EventService eventService,
this.positionService = positionService;
}

@Operation(summary = "Get all events with their positions.", description = "We are going to retrieve all events with their position")
@GetMapping("/events")
public ResponseEntity<List<EventDTO>> getAllEvents(){
List<EventDTO> events = eventService.getEvents();
Expand All @@ -34,6 +36,7 @@ public ResponseEntity<List<EventDTO>> getAllEvents(){

return ResponseEntity.ok(this.eventService.getEvents());
}
@Operation(summary = "Get an event with its position by ID.", description = "We are going to recover an event with its position through the event's ID.")
@GetMapping("/position/{id}")
public ResponseEntity<EventDTO> getEventPositionById(@PathVariable String id){
Optional<EventDTO> eventOpt = eventService.getEvents().stream()
Expand Down

0 comments on commit a52c466

Please sign in to comment.