Skip to content

Commit

Permalink
updated API Specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jogli5er committed Sep 13, 2014
1 parent 5dd0359 commit bd61ad4
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ Response:

{
"moves": [
{ "id": 0, "name": "Column 1" },
{ "id": 1, "name": "Column 2" },
{ "id": 2, "name": "Column 3" },
{ "id": 0, "name": "Column 1" , "usersSelected": integer},
{ "id": 1, "name": "Column 2" , "usersSelected": integer},
{ "id": 2, "name": "Column 3" , "usersSelected": integer},
],
"totalActiveUsers": integer,
"currentMoveTTL": 23,
"currentTeamId":"givesUsBackTheCurrentPlayingTeam",
"isFinished" : false
Expand Down
104 changes: 104 additions & 0 deletions README.md~
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
## API Clients-Server

### GET game/join

Response:

{
"teams": [
{ "id": 0, "name": "red" },
{ "id": 1, "name": "blue" },
],
"currentMoveTTL": INTEGER
}

### POST game/join

Data (id of selected Team):

1

Response:

{
"sessionId": "irgendetwas",
"startingTeamId": "givesUsBackTheStartingTeam",
"currentMoveTTL": INTEGER
}

### GET game/move

Response:

{
"moves": [
{ "id": 0, "name": "Column 1" },
{ "id": 1, "name": "Column 2" },
{ "id": 2, "name": "Column 3" },
],
"currentMoveTTL": 23,
"currentTeamId":"givesUsBackTheCurrentPlayingTeam",
"isFinished" : false
}


### POST game/move/user/{user_id}

Data (id of selected move):

2

Response:

{
"moves": [
{ "id": 0, "name": "Column 1" },
{ "id": 1, "name": "Column 2" },
{ "id": 2, "name": "Column 3" },
],
"currentMoveTTL": 21
}

## Teletext-API

### Spielbrett-Vorschlag

======================================
T E L E G A M E
======================================
It's o's move (not x's)

1 2 3 4 5 6 7
+---+---+---+---+---+---+---+
I I x I I I I I I
+---+---+---+---+---+---+---+
I o I o I I I I I I
+---+---+---+---+---+---+---+
I o I o I I I I I I
+---+---+---+---+---+---+---+
I x I x I x I I I I I
+---+---+---+---+---+---+---+
I o I x I o I I I x I I
+---+---+---+---+---+---+---+
I o I x I o I x I o I o I x I
+---+---+---+---+---+---+---+
I o I o I o I x I o I o I o I
+---+---+---+---+---+---+---+


### Zeichen, die von der Teletext-API akteptiert werden:
!?=_-/+§°"#*'><;.I

### Zeichen, die von der Teletext-API nicht akteptiert werden:

\ => /
| => /
@ => §
¬ => -
~ => -
[ => <
] => >
{ => <
} => >
« => "
» => "
2 changes: 1 addition & 1 deletion frontend/website/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
m = data.moves[i];
html += '<button type="button" class="btn btn-primary" data-value="' + m.id + '">' + m.name + '</button>' + "\n";
html += '<div class="progress active">';
html += '<div class="bar" style="width: '+getPercentages(data.sum, data.moves[i].usersSelected);+';"><span>'+data.moves[i].usersSelected+'</span></div>' //TODO: Check compatibility with backend
html += '<div class="bar" style="width: '+getPercentages(data.totalActiveUsers, data.moves[i].usersSelected);+';"><span>'+data.moves[i].usersSelected+'</span></div>' //TODO: Check compatibility with backend
html += '</div>'
html += '</div>';
}
Expand Down

0 comments on commit bd61ad4

Please sign in to comment.