Skip to content

Instantly share code, notes, and snippets.

@chopmann
Last active August 29, 2015 14:13
Show Gist options
  • Save chopmann/0d31fa16bc309cc78e86 to your computer and use it in GitHub Desktop.
Save chopmann/0d31fa16bc309cc78e86 to your computer and use it in GitHub Desktop.
Test-Server (Woingenau Backend)
http://thawing-stream-9266.herokuapp.com/
${id} = 1 (zum Testen)
| 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
Quellcode:
https://github.com/chopmann/Woingenau
Die meisten "Commits" sind von mir, da ich für die Integration des Quellcode verantwortlich war.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment