Commit 9375d639 authored by Marek Kadlečík's avatar Marek Kadlečík
Browse files

Added delete operation to rest api

parent 653fc890
......@@ -37,12 +37,16 @@ Find player according to `uuid`:
$ curl -X GET http://localhost:8080/pa165/rest/players/9384b466-badf-40ca-bbeb-4d8f6eb98042
```
Find all players:
```bash
$ curl -X GET http://localhost:8080/pa165/rest/players
```
Delete player:
```bash
$ curl -X DELETE http://localhost:8080/pa165/rest/players/9384b466-badf-40ca-bbeb-4d8f6eb98042
```
## Diagrams for assignment
### Class diagram
![Class diagram for this project](diagrams/UML class diagram.png)
......
......@@ -47,4 +47,13 @@ public class PlayerController {
throw new ResourceAlreadyExistsException();
}
}
@RequestMapping(value = "/{uuid}", method = RequestMethod.DELETE)
public final void delete(@PathVariable("uuid") String uuid) throws ResourceNotFoundException {
try {
playerFacade.delete(uuid);
} catch (Exception ex) {
throw new ResourceNotFoundException();
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment