69 lines
1.0 KiB
Markdown
69 lines
1.0 KiB
Markdown
# Endpunkte
|
|
|
|
GET /api/person -> Get all persons
|
|
GET /api/person/username/{username} -> Get person
|
|
POST /api/person -> Create
|
|
PUT /api/person/username/{username} -> Update
|
|
DELETE /api/person/username/{username} -> Delete
|
|
|
|
# Personen-Modell
|
|
|
|
String username
|
|
String realName
|
|
DateOnly birthday
|
|
|
|
# Beispiele
|
|
## Beispiel 1
|
|
Request:
|
|
POST /api/person
|
|
{
|
|
"username": "marco",
|
|
"realName": "Marco",
|
|
"birthday": "2000-01-26"
|
|
}
|
|
|
|
Response: 201
|
|
|
|
## Beispiel 2
|
|
Request:
|
|
POST /api/person
|
|
{
|
|
"username": "m",
|
|
"realName": "Marco",
|
|
"birthday": "2000-01-26"
|
|
}
|
|
|
|
Response: 400
|
|
|
|
## Beispel 3
|
|
|
|
1. Request:
|
|
POST /api/person
|
|
{
|
|
"username": "marco",
|
|
"realName": "Marco",
|
|
"birthday": "2000-01-26"
|
|
}
|
|
Response: 201
|
|
|
|
2. Request:
|
|
POST /api/person
|
|
{
|
|
"username": "marco",
|
|
"realName": "Marco",
|
|
"birthday": "2000-01-26"
|
|
}
|
|
Response: 409
|
|
|
|
## Beispiel 4
|
|
|
|
|
|
Request:
|
|
POST /api/person
|
|
{
|
|
"username": "marco",
|
|
"realName": "Marco",
|
|
"birthday": "2020-01-26"
|
|
}
|
|
Response: 400 Person muss 16 Jahre alt sein
|