Package dev.vernite.vernite.status
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(@NotNull User user, long projectId, @Valid CreateStatus create) Creates new status for project with given ID.voidDeletes status with given ID.Retrieves status with given ID.Retrieves all statuses for project with given ID.update(@NotNull User user, long projectId, long id, @Valid UpdateStatus update) Updates status with given ID.
-
Constructor Details
-
StatusController
public StatusController()
-
-
Method Details
-
getAll
Retrieves all statuses for project with given ID. Statuses will be ordered by ordinal number.- Parameters:
user- logged in userprojectId- 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 userprojectId- ID of projectcreate- 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 userprojectId- ID of projectid- 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 userprojectId- ID of projectid- ID of statusupdate- 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 userprojectId- ID of projectid- ID of status
-