@RestController @RequestMapping(value="/api") public class GameResource extends Object
| Constructor and Description |
|---|
GameResource(GameService gameService,
UserRepository userRepository) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<Game> |
bootGame(@Valid Game game,
@Valid @NotNull Boolean overwrite) |
org.springframework.http.ResponseEntity<Void> |
closeGame() |
org.springframework.http.ResponseEntity<Game> |
createGame(@Valid Game game)
POST /games : Create a new game.
|
org.springframework.http.ResponseEntity<Void> |
deleteGame(Long id)
DELETE /games/:id : delete the "id" game.
|
org.springframework.http.ResponseEntity<List<Game>> |
getAllGames(org.springframework.data.domain.Pageable pageable)
GET /games : get all the games.
|
org.springframework.http.ResponseEntity<Game> |
getGame(Long id)
GET /games/:id : get the "id" game.
|
org.springframework.http.ResponseEntity<List<Game>> |
getMyGames()
Get all games owned by logged in user, plus all shared files.
|
org.springframework.http.ResponseEntity<Void> |
replayGameExternal(@Valid String url) |
org.springframework.http.ResponseEntity<Void> |
replayGameInternal(@Valid File file) |
org.springframework.http.ResponseEntity<Game> |
simGame(@Valid Game game,
@Valid @NotNull Boolean overwrite) |
org.springframework.http.ResponseEntity<Game> |
updateGame(@Valid Game game)
PUT /games : Updates an existing game.
|
public GameResource(GameService gameService, UserRepository userRepository)
@PostMapping(value="/games") @Timed public org.springframework.http.ResponseEntity<Game> createGame(@Valid @RequestBody @Valid Game game) throws URISyntaxException
game - the game to createURISyntaxException - if the Location URI syntax is incorrect@PutMapping(value="/games") @Timed public org.springframework.http.ResponseEntity<Game> updateGame(@Valid @RequestBody @Valid Game game) throws URISyntaxException
game - the game to updateURISyntaxException - if the Location URI syntax is incorrect@GetMapping(value="/games") @Timed public org.springframework.http.ResponseEntity<List<Game>> getAllGames(org.springframework.data.domain.Pageable pageable) throws URISyntaxException
pageable - the pagination informationURISyntaxException - if there is an error to generate the pagination HTTP headers@GetMapping(value="/games/{id}")
@Timed
public org.springframework.http.ResponseEntity<Game> getGame(@PathVariable
Long id)
id - the id of the game to retrieve@DeleteMapping(value="/games/{id}")
@Timed
public org.springframework.http.ResponseEntity<Void> deleteGame(@PathVariable
Long id)
id - the id of the game to delete@GetMapping(value="/mygames") @Timed public org.springframework.http.ResponseEntity<List<Game>> getMyGames() throws URISyntaxException
URISyntaxException@PostMapping(value="/bootgame") @Timed public org.springframework.http.ResponseEntity<Game> bootGame(@Valid @RequestBody @Valid Game game, @RequestParam(value="overwrite") @Valid @NotNull @Valid @NotNull Boolean overwrite) throws URISyntaxException, org.apache.commons.io.FileExistsException
URISyntaxExceptionorg.apache.commons.io.FileExistsException@PostMapping(value="/simgame") @Timed public org.springframework.http.ResponseEntity<Game> simGame(@Valid @RequestBody @Valid Game game, @RequestParam(value="overwrite") @Valid @NotNull @Valid @NotNull Boolean overwrite) throws URISyntaxException
URISyntaxException@PostMapping(value="/replaygame_internal") @Timed public org.springframework.http.ResponseEntity<Void> replayGameInternal(@Valid @RequestBody @Valid File file) throws URISyntaxException, IOException
URISyntaxExceptionIOException@PostMapping(value="/replaygame_external") @Timed public org.springframework.http.ResponseEntity<Void> replayGameExternal(@Valid @RequestBody @Valid String url) throws URISyntaxException, MalformedURLException, IOException
@PostMapping(value="/closegame") @Timed public org.springframework.http.ResponseEntity<Void> closeGame() throws IllegalStateException
IllegalStateExceptionCopyright © 2019 Power TAC. All rights reserved.