Class BaseTaskControllerWithoutRequestMapping<E extends Task,D,A>
java.lang.Object
at.jku.dke.etutor.task_app.controllers.BaseTaskControllerWithoutRequestMapping<E,D,A>
- Type Parameters:
E
- The type of the task entity.D
- The type of the task DTO.A
- The type of the additional data inModifyTaskDto
.
- All Implemented Interfaces:
TaskController<D,
A>
- Direct Known Subclasses:
BaseTaskController
public abstract class BaseTaskControllerWithoutRequestMapping<E extends Task,D,A>
extends Object
implements TaskController<D,A>
Base implementation of
TaskController
.
Add @RestController
and @RequestMapping("/api/task/[subpath]")
to the extending class.
If your task app only supports one task type, you can use BaseTaskController
instead.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseTaskControllerWithoutRequestMapping
(TaskService<E, A> taskService) Creates a new instance of classBaseTaskControllerWithoutRequestMapping
. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(long id, ModifyTaskDto<A> dto) Creates a new task.protected abstract URI
createDetailsUri
(long id) Creates the URI for the details of the task with the given ID.delete
(long id) Deletes the task.get
(long id) Returns the task type specific data.protected abstract D
Maps the given task group to a DTO.update
(long id, ModifyTaskDto<A> dto) Updates the task data.
-
Field Details
-
taskService
The task group service.
-
-
Constructor Details
-
BaseTaskControllerWithoutRequestMapping
Creates a new instance of classBaseTaskControllerWithoutRequestMapping
.- Parameters:
taskService
- The task group service.
-
-
Method Details
-
get
Returns the task type specific data.- Specified by:
get
in interfaceTaskController<E extends Task,
D> - Parameters:
id
- The identifier of the requested task.- Returns:
- The task details or an error response.
-
create
Creates a new task.- Specified by:
create
in interfaceTaskController<E extends Task,
D> - 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.
-
update
Updates the task data.- Specified by:
update
in interfaceTaskController<E extends Task,
D> - Parameters:
id
- The identifier of the task.dto
- The new task data.- Returns:
- The task-specific task data or an error response.
-
delete
Deletes the task.- Specified by:
delete
in interfaceTaskController<E extends Task,
D> - Parameters:
id
- The identifier of the task.- Returns:
- No content or an error response.
-
mapToDto
Maps the given task group to a DTO.- Parameters:
entity
- The task group entity.- Returns:
- The DTO.
-
createDetailsUri
Creates the URI for the details of the task with the given ID.- Parameters:
id
- The ID of the task.- Returns:
- The URI where the details of the task can be found.
-