Created
December 8, 2014 20:35
-
-
Save chopmann/da57cc940d952e9b63cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GET | /courses | Action: index | | |
Liefert - Liste (format unten): | |
| GET | /courses/${id} | Action: show | | |
Liefert ein Element ( | |
[ | |
{ | |
"id": 1, | |
"appointments": [ | |
{ | |
"id": 1, | |
"place": "Empire", | |
"start": "2014-12-08T20:21:03Z", | |
"end": "2014-12-08T20:21:03Z" | |
} | |
], | |
"creator": { | |
"id": 1 | |
}, | |
"lecturer": { | |
"id": 2 | |
}, | |
"members": [ | |
{ | |
"id": 2 | |
}, | |
{ | |
"id": 3 | |
}, | |
{ | |
"id": 1 | |
} | |
], | |
"title": "The Force 101" | |
} | |
] | |
| POST | /courses | Action: save | | |
Benutzt: | |
[ | |
{ | |
"appointments": [ | |
{ | |
"place": "Earth", | |
"start": "2014-12-08T20:21:03Z", | |
"end": "2014-12-08T20:21:03Z" | |
} | |
], | |
"creator": { | |
"id": 1 | |
}, | |
"lecturer": { | |
"id": 2 | |
}, | |
"members": [ | |
{ | |
"id": 2 | |
}, | |
{ | |
"id": 3 | |
}, | |
{ | |
"id": 1 | |
} | |
], | |
"title": "The Force 101" | |
} | |
] | |
Speichert ein neuer Course in der DB | |
| PUT | /courses/${id} | Action: update | | |
Updates nur : | |
[ | |
{ | |
"creator": { | |
"id": 1 | |
}, | |
"lecturer": { | |
"id": 2 | |
}, | |
"title": "The Force 102" | |
} | |
] | |
| GET | /courses/${courseId}/members | Action: index | | |
enabled: true|false ist ob der user freigeschaltet ist. Sollte euch nicht interessieren. | |
[ | |
{ | |
"id": 3, | |
"username": "hans", | |
"firstname": "hans", | |
"lastname": "hodor", | |
"enabled": true | |
}, | |
{ | |
"id": 1, | |
"username": "jack", | |
"firstname": "jack", | |
"lastname": "bauer", | |
"enabled": true | |
}, | |
{ | |
"id": 2, | |
"username": "joda", | |
"firstname": "joda", | |
"lastname": "maier", | |
"enabled": true | |
} | |
] | |
| POST | /courses/${courseId}/members | Action: save | | |
Fügt ein neue User zum Course | |
[ | |
{ | |
"id": 3 | |
} | |
] | |
| DELETE | /courses/${courseId}/members | Action: delete | | |
Analog zu save | |
Es gilt: | |
Für Action: save ist keine id nötig, es wird generiert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment