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 in ModifyTaskGroupDto.
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 Details

  • Constructor Details

  • Method Details

    • get

      public ResponseEntity<D> get(long id)
      Returns the task group data.
      Specified by:
      get in interface TaskGroupController<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 interface TaskGroupController<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 interface TaskGroupController<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

      public ResponseEntity<Void> delete(long id)
      Deletes the task group.
      Specified by:
      delete in interface TaskGroupController<E extends TaskGroup,D>
      Parameters:
      id - The identifier of the task group.
      Returns:
      No content or an error response.
    • mapToDto

      protected abstract D mapToDto(E entity)
      Maps the given task group to a DTO.
      Parameters:
      entity - The task group entity.
      Returns:
      The DTO.
    • createDetailsUri

      protected abstract URI createDetailsUri(long id)
      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.