@RestController @RequestMapping(value="/api") public class ChartResource extends Object
| Constructor and Description |
|---|
ChartResource(ChartService chartService,
UserRepository userRepository) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<Chart> |
createChart(Chart chart)
POST /charts : Create a new chart.
|
org.springframework.http.ResponseEntity<Void> |
deleteChart(Long id)
DELETE /charts/:id : delete the "id" chart.
|
org.springframework.http.ResponseEntity<List<Chart>> |
getAllCharts(org.springframework.data.domain.Pageable pageable)
GET /charts : get all the charts.
|
org.springframework.http.ResponseEntity<Chart> |
getChart(Long id)
GET /charts/:id : get the "id" chart.
|
org.springframework.http.ResponseEntity<List<Chart>> |
getMyGames()
Get all charts owned by logged in user, plus all shared charts.
|
org.springframework.http.ResponseEntity<Chart> |
updateChart(Chart chart)
PUT /charts : Updates an existing chart.
|
public ChartResource(ChartService chartService, UserRepository userRepository)
@PostMapping(value="/charts") @Timed public org.springframework.http.ResponseEntity<Chart> createChart(@RequestBody Chart chart) throws URISyntaxException
chart - the chart to createURISyntaxException - if the Location URI syntax is incorrect@PutMapping(value="/charts") @Timed public org.springframework.http.ResponseEntity<Chart> updateChart(@RequestBody Chart chart) throws URISyntaxException
chart - the chart to updateURISyntaxException - if the Location URI syntax is incorrect@GetMapping(value="/charts") @Timed public org.springframework.http.ResponseEntity<List<Chart>> getAllCharts(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="/charts/{id}")
@Timed
public org.springframework.http.ResponseEntity<Chart> getChart(@PathVariable
Long id)
id - the id of the chart to retrieve@DeleteMapping(value="/charts/{id}")
@Timed
public org.springframework.http.ResponseEntity<Void> deleteChart(@PathVariable
Long id)
id - the id of the chart to delete@GetMapping(value="/mycharts") @Timed public org.springframework.http.ResponseEntity<List<Chart>> getMyGames() throws URISyntaxException
URISyntaxExceptionCopyright © 2018 Power TAC. All rights reserved.