Interface TaskController<D,T>
- Type Parameters:
D
- The type of the task DTO.T
- The type of the additional data inModifyTaskDto
.
- All Known Implementing Classes:
BaseTaskController
,BaseTaskControllerWithoutRequestMapping
public interface TaskController<D,T>
Controller for managing tasks.
Add @RestController
and @RequestMapping("/api/task")
to the implementing class.
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(long id, ModifyTaskDto<T> dto) Creates a new task.delete
(long id) Deletes the task.get
(long id) Returns the task type specific data.update
(long id, ModifyTaskDto<T> dto) Updates the task data.
-
Method Details
-
get
@GetMapping(value="/{id}", produces="application/json") ResponseEntity<D> get(@PathVariable long id) Returns the task type specific data.- Parameters:
id
- The identifier of the requested task.- Returns:
- The task details or an error response.
- Implementation Requirements:
- Only clients with role
AuthConstants.CRUD
should be allowed to access this endpoint.
-
create
@PostMapping(value="/{id}", produces="application/json", consumes="application/json") ResponseEntity<TaskModificationResponseDto> create(@PathVariable long id, @RequestBody ModifyTaskDto<T> dto) Creates a new task.- Parameters:
id
- The identifier of the task (generated by task administration app).dto
- The task data.- Returns:
- The task-specific task data or an error response.
- Implementation Requirements:
- Only clients with role
AuthConstants.CRUD
should be allowed to access this endpoint.
-
update
@PutMapping(value="/{id}", consumes="application/json") ResponseEntity<TaskModificationResponseDto> update(@PathVariable long id, @RequestBody ModifyTaskDto<T> dto) Updates the task data.- Parameters:
id
- The identifier of the task.dto
- The new task data.- Returns:
- The task-specific task data or an error response.
- Implementation Requirements:
- Only clients with role
AuthConstants.CRUD
should be allowed to access this endpoint.
-
delete
Deletes the task.- Parameters:
id
- The identifier of the task.- Returns:
- No content or an error response.
- Implementation Requirements:
- Only clients with role
AuthConstants.CRUD
should be allowed to access this endpoint.
-