added api design
This commit is contained in:
1 parent
db88d1d9d9
commit
e834ff623b
1 file changed
+68
@@ -0,0 +1,68 @@
|
|||||||
|
# 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
|
||||||
Reference in new issue
Block a user