Archived
52 lines
1.3 KiB
Markdown
52 lines
1.3 KiB
Markdown
# REST-API
|
|
|
|
Basisroute: `/api`
|
|
|
|
Die genaue Endpoint-, Request- und Response-Dokumentation steht im Development in der Swagger UI unter `/swagger`.
|
|
|
|
## Schüler
|
|
|
|
- `GET /students?skip=0&take=100`
|
|
- `GET /students/{id}`
|
|
- `GET /students/by-card/{nr}`
|
|
- `GET /students/search?name=`
|
|
- `POST /students`
|
|
- `PUT /students/{id}`
|
|
- `DELETE /students/{id}`
|
|
|
|
## Bücher
|
|
|
|
- `GET /books?availableOnly=&skip=0&take=100`
|
|
- `GET /books/{id}`
|
|
- `GET /books/by-number/{nr}`
|
|
- `GET /books/search?title=`
|
|
- `GET /books/search?author=`
|
|
- `GET /books/search?subject=`
|
|
- `POST /books`
|
|
- `PUT /books/{id}`
|
|
- `DELETE /books/{id}`
|
|
|
|
Buch- und Schülersuche werden datenbankseitig gefiltert.
|
|
|
|
## Ausleihe
|
|
|
|
- `POST /loans/verify` prüft Schüler, Buch und Verfügbarkeit ohne Datenänderung.
|
|
- `POST /loans` prüft erneut und legt die Ausleihe transaktional an.
|
|
|
|
## Rückgabe
|
|
|
|
- `GET /returns/verify/{nr}` liefert die aktive Ausleihe und den Überfälligkeitsstatus.
|
|
- `POST /returns` schließt die aktive Ausleihe transaktional ab.
|
|
|
|
## Reports
|
|
|
|
- `GET /reports`
|
|
- `GET /reports/active-loans?skip=0&take=100`
|
|
- `GET /reports/active-students?skip=0&take=100`
|
|
- `GET /reports/overdue?skip=0&take=100`
|
|
- `GET /reports/statistics`
|
|
|
|
`GET /reports` liefert die ersten 100 Einträge je Liste plus vollständige Statistiken.
|
|
|
|
Fehler verwenden `application/problem+json` mit `status`, `title`, `detail` und `instance`.
|