Class TodosController

java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.TodosController

@RequestMapping("/api/todos") @RestController public class TodosController extends ApiController
  • Constructor Details

    • TodosController

      public TodosController()
  • Method Details

    • allUsersTodos

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/all") public Iterable<Todo> allUsersTodos()
    • thisUsersTodos

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<Todo> thisUsersTodos()
    • getTodoById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public Todo getTodoById(@RequestParam Long id)
    • getTodoById_admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin") public Todo getTodoById_admin(@RequestParam Long id)
    • postTodo

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PostMapping("/post") public Todo postTodo(@RequestParam String title, @RequestParam String details, @RequestParam Boolean done)
    • deleteTodo

      @PreAuthorize("hasRole(\'ROLE_USER\')") @DeleteMapping("") public Object deleteTodo(@RequestParam Long id)
    • deleteTodo_Admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/admin") public Object deleteTodo_Admin(@RequestParam Long id)
    • putTodoById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PutMapping("") public Todo putTodoById(@RequestParam Long id, @RequestBody @Valid @Valid Todo incomingTodo)
    • putTodoById_admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("/admin") public Todo putTodoById_admin(@RequestParam Long id, @RequestBody @Valid @Valid Todo incomingTodo)