class UserErrorMessageController {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Operation(tags = {"user-errors"}, summary = "Return last user errors for all users",
        description = "Extract descending ordered user errors until the specified db_id reached. Limit is specified by parameter",
        security = @SecurityRequirement(name = "admin_api_key"),
        responses = @ApiResponse(description = "User error message representation. Timestamp corresponds to UTC time.", responseCode = "200", content = @Content(mediaType = "application/json", schema = @Schema(implementation = UserErrorMessage.class))))
    @RolesAllowed("admin")
    public Response getAll(@Parameter(description = "db id to which user-errors should be extracted. By default is Long.MAX_VALUE") @QueryParam("toDbId") @DefaultValue("" + Long.MAX_VALUE) long toDbId,
                           @Parameter(description = "Number of entries to extract. By default is 100.") @QueryParam("limit") @DefaultValue("100") int limit) {
        int correctedLimit = Math.max(0, limit);
        return Response.ok(service.getAll(toDbId, correctedLimit)).build();
    }

    public  UserErrorMessageController();
    @Inject public  UserErrorMessageController(UserErrorMessageService service);

}