@RestController @RequestMapping(value="/api") public class ViewResource extends Object
| Constructor and Description |
|---|
ViewResource(ViewService viewService,
UserRepository userRepository) |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<View> |
createView(View view)
POST /views : Create a new view.
|
org.springframework.http.ResponseEntity<Void> |
deleteView(Long id)
DELETE /views/:id : delete the "id" view.
|
org.springframework.http.ResponseEntity<List<View>> |
getAllViews(org.springframework.data.domain.Pageable pageable)
GET /views : get all the views.
|
org.springframework.http.ResponseEntity<List<View>> |
getMyViews()
Get all views owned by logged in user, plus all shared views.
|
org.springframework.http.ResponseEntity<View> |
getView(Long id)
GET /views/:id : get the "id" view.
|
org.springframework.http.ResponseEntity<View> |
updateView(View view)
PUT /views : Updates an existing view.
|
public ViewResource(ViewService viewService, UserRepository userRepository)
@PostMapping(value="/views") @Timed public org.springframework.http.ResponseEntity<View> createView(@RequestBody View view) throws URISyntaxException
view - the view to createURISyntaxException - if the Location URI syntax is incorrect@PutMapping(value="/views") @Timed public org.springframework.http.ResponseEntity<View> updateView(@RequestBody View view) throws URISyntaxException
view - the view to updateURISyntaxException - if the Location URI syntax is incorrect@GetMapping(value="/views") @Timed public org.springframework.http.ResponseEntity<List<View>> getAllViews(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="/views/{id}")
@Timed
public org.springframework.http.ResponseEntity<View> getView(@PathVariable
Long id)
id - the id of the view to retrieve@DeleteMapping(value="/views/{id}")
@Timed
public org.springframework.http.ResponseEntity<Void> deleteView(@PathVariable
Long id)
id - the id of the view to delete@GetMapping(value="/myviews") @Timed public org.springframework.http.ResponseEntity<List<View>> getMyViews() throws URISyntaxException
URISyntaxExceptionCopyright © 2017 Power TAC. All rights reserved.