| ... | @@ -40,4 +40,48 @@ Uses some decorators as explained in the [User](./user) page, but it also has so |
... | @@ -40,4 +40,48 @@ Uses some decorators as explained in the [User](./user) page, but it also has so |
|
|
|
|
|
|
|
- `image` is the path to the image and is limited to 65 characters
|
|
- `image` is the path to the image and is limited to 65 characters
|
|
|
|
|
|
|
|
### moti loppu |
|
### edit a created game, PUT /game/edit/{game's UUID}
|
|
|
|
|
|
|
|
- Uses the Roles-decorator to only pass requests made by a person with admin-role in the game
|
|
|
|
|
|
|
|
- Uses the States-decorator to only pass requests where the game's state is set to `STARTED`
|
|
|
|
|
|
|
|
- Body is validated as GameDTO as specified in `game.dto.ts`
|
|
|
|
|
|
|
|
### delete a game, DELETE /game/delete/{game's UUID}
|
|
|
|
|
|
|
|
- Uses the Roles-decorator to only pass requests made by a person with admin-role in the game
|
|
|
|
|
|
|
|
- Uses the States-decorator to only pass requests where the game's state is set to `STARTED`
|
|
|
|
|
|
|
|
### update game's state, PUT /game/edit-state/{game's UUID}
|
|
|
|
|
|
|
|
- Uses the Roles-decorator to only pass requests made by a person with admin-role in the game
|
|
|
|
|
|
|
|
- Valid states are ['CREATED', 'STARTED', 'PAUSED', 'ENDED']
|
|
|
|
|
|
|
|
### list all games, GET /game/listgames/{state}
|
|
|
|
|
|
|
|
- Valid states are ['CREATED', 'STARTED', 'PAUSED', 'ENDED']
|
|
|
|
|
|
|
|
### list game info, GET /game/{game's UUID}
|
|
|
|
|
|
|
|
- Uses the `ClassSerializerInterceptor` to remove columns with `@Excluded` decorator
|
|
|
|
|
|
|
|
### list all factions, GET /game/get-factions/{game's UUID}
|
|
|
|
|
|
|
|
- Uses the Roles-decorator to only pass requests made by a person with admin-role in the game
|
|
|
|
|
|
|
|
### file upload, POST /game/upload
|
|
|
|
|
|
|
|
- Uses the FileInterceptor to overwrite some default settings
|
|
|
|
|
|
|
|
- Uploaded file must be uploaded as formdata with `image` as the key
|
|
|
|
|
|
|
|
- Generates a random string for the filename
|
|
|
|
|
|
|
|
- Returns the generated string that can be sent with newGameDTO when creating a new game
|
|
|
|
|
|
|
|
### get image, GET /game/images/{filename}
|
|
|
|
|
|
|
|
- Sends the file from `/images` folder identified by the filename in the URL |