... | ... | @@ -20,14 +20,90 @@ Returns the round with id = roundId on the form: |
|
|
}
|
|
|
```
|
|
|
|
|
|
### POST url/api/tournament/join
|
|
|
|
|
|
Joins the oldest tournament stil active and on round 1.
|
|
|
### GET uri/api/rounds/latestpoints/:tournamentId/:playerId
|
|
|
|
|
|
Parameters:
|
|
|
* tournamentId (String, must be a valid MongoDB ID)
|
|
|
* playerId (String, must be a valid MongoDB ID)
|
|
|
|
|
|
Returns the latest tournamentPoints greater than zero for a player on a specific tournament on the form:
|
|
|
```json
|
|
|
[{
|
|
|
"_id": (String, valid MongoID),
|
|
|
"tournamentPoints": (Int)
|
|
|
}]
|
|
|
```
|
|
|
|
|
|
|
|
|
### GET uri/api/rounds/tournamentpoints/:tournamentId/:playerId
|
|
|
|
|
|
Parameters:
|
|
|
* tournamentId (String, must be a valid MongoDB ID)
|
|
|
* playerId (String, must be a valid MongoDB ID)
|
|
|
|
|
|
Returns total tournamentPoints for a player on a specific tournament on the form:
|
|
|
```json
|
|
|
{
|
|
|
"tournamentPoints": (Int)
|
|
|
}
|
|
|
```
|
|
|
|
|
|
### GET uri/api/rounds/specific/:tournamentId/:playerId/:roundNr
|
|
|
|
|
|
Parameters:
|
|
|
* tournamentId (String, must be a valid MongoDB ID)
|
|
|
* playerId (String, must be a valid MongoDB ID)
|
|
|
* roundNr (Int)
|
|
|
|
|
|
Returns the specific round for player on a specific tournament in a specific roundnumber on the form:
|
|
|
```json
|
|
|
{
|
|
|
"_id": (String, valid MongoID),
|
|
|
"tournamentId": String, valid MongoID),
|
|
|
"playerId": (String, valid MongoID),
|
|
|
"gameId": (String, valid MongoID),
|
|
|
"scoreValue": (Int),
|
|
|
"roundNr": (Int),
|
|
|
"hasPlayed": (Boolean),
|
|
|
"deadlineDate": (String, valid date),
|
|
|
"tournamentPoints": (Int)
|
|
|
}
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### POST uri/api/rounds/
|
|
|
|
|
|
Posts a new round.
|
|
|
|
|
|
body:
|
|
|
```json
|
|
|
{
|
|
|
"tournamentId": String, valid MongoID),
|
|
|
"playerId": (String, valid MongoID),
|
|
|
"gameId": (String, valid MongoID),
|
|
|
"roundNr": (Int),
|
|
|
"deadlineDate": (String, valid date)
|
|
|
}
|
|
|
```
|
|
|
|
|
|
### PUT uri/api/rounds/:roundId/
|
|
|
|
|
|
Parameters:
|
|
|
* roundId (String, must be a valid MongoDB ID)
|
|
|
|
|
|
Updates the round with id=roundId with the scoreValue in the body.
|
|
|
Also updates the highscores of the player and game.
|
|
|
|
|
|
body:
|
|
|
```json
|
|
|
{
|
|
|
"playerId": (String, must be a valid MongoDB ID)
|
|
|
"scoreValue": (Int),
|
|
|
"playerId": (String, valid MongoID),
|
|
|
"gameId": (String, valid MongoID)
|
|
|
|
|
|
}
|
|
|
```
|
|
|
|
|
|
|