generated from 2martens/template-service
Added operation to request all agenda items in a body
This commit is contained in:
@ -252,6 +252,24 @@ public class OParlController {
|
||||
});
|
||||
}
|
||||
|
||||
@GetMapping("/body/{id}/agendaItems")
|
||||
@Operation(summary = "List of all agenda items in body",
|
||||
description = "returns a list of all agenda items in requested body", responses = {
|
||||
@ApiResponse(description = "Successful Operation", responseCode = "200",
|
||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = ObjectList.class))),
|
||||
@ApiResponse(responseCode = "404", description = "Not found", content = @Content(mediaType = "application/json",
|
||||
schema = @Schema(implementation = ErrorObject.class)))
|
||||
})
|
||||
public ObjectList<AgendaItem> agendaItemsInBody(
|
||||
@PathVariable
|
||||
@Parameter(description = "body ID", example = "0")
|
||||
String id) {
|
||||
log.info("invoked method /v1.1/body/{}/agendaItems", id);
|
||||
return service.getAgendaItemsInBody(id).orElseThrow(() -> {
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Keine Körperschaft mit angefragter ID existiert");
|
||||
});
|
||||
}
|
||||
|
||||
@GetMapping("/agendaItem/{id}")
|
||||
@Operation(summary = "information about agenda item", description = "returns the requested agenda item", responses = {
|
||||
@ApiResponse(description = "Successful Operation", responseCode = "200",
|
||||
|
||||
@ -16,6 +16,10 @@ public class OParlService {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public Optional<ObjectList<AgendaItem>> getAgendaItemsInBody(String bodyID) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public Optional<AgendaItem> getAgendaItem(String id) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user