Added operation to request all agenda items in a body

This commit is contained in:
2020-07-11 21:11:36 +02:00
parent c3c20d9ecf
commit d2b8ae5b6d
3 changed files with 40 additions and 0 deletions

View File

@ -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",

View File

@ -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();
}