Class StatusController

java.lang.Object
dev.vernite.vernite.status.StatusController

@RestController @RequestMapping("/project/{projectId}/status") public class StatusController extends Object
Rest controller for performing CRUD operations on Status entities.
  • Constructor Details

    • StatusController

      public StatusController()
  • Method Details

    • getAll

      @GetMapping public List<Status> getAll(@NotNull @NotNull User user, @PathVariable long projectId)
      Retrieves all statuses for project with given ID. Statuses will be ordered by ordinal number.
      Parameters:
      user - logged in user
      projectId - ID of project
      Returns:
      list of statuses
    • create

      @PostMapping public Status create(@NotNull @NotNull User user, @PathVariable long projectId, @RequestBody @Valid @Valid CreateStatus create)
      Creates new status for project with given ID.
      Parameters:
      user - logged in user
      projectId - ID of project
      create - data for new status
      Returns:
      newly created status
    • get

      @GetMapping("/{id}") public Status get(@NotNull @NotNull User user, @PathVariable long projectId, @PathVariable long id)
      Retrieves status with given ID.
      Parameters:
      user - logged in user
      projectId - ID of project
      id - ID of status
      Returns:
      status with given ID
    • update

      @PutMapping("/{id}") public Status update(@NotNull @NotNull User user, @PathVariable long projectId, @PathVariable long id, @RequestBody @Valid @Valid UpdateStatus update)
      Updates status with given ID. Performs partial update using only supplied fields from request body.
      Parameters:
      user - logged in user
      projectId - ID of project
      id - ID of status
      update - data to update
      Returns:
      updated status
    • delete

      @DeleteMapping("/{id}") public void delete(@NotNull @NotNull User user, @PathVariable long projectId, @PathVariable long id)
      Deletes status with given ID. Status must be empty.
      Parameters:
      user - logged in user
      projectId - ID of project
      id - ID of status