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