Services - THM-ATLAS/spring-backend GitHub Wiki

Overview

Path

src/main/kotlin/com/example/atlasbackend/service

Construction

Services are classes which are marked with the annotation @Service. In the constructor they are passed all the Repositories that the service needs to perform its tasks.

Tasks

Services are called by the RestControllers and take care of the backend logic. They check and control the inputs and outputs.

The main tasks are:

  • Checking the authorization of the requester, if the user has a role with sufficient rights.
  • Checking the input data, if it is possible to continue working with it or if it would cause errors.
  • Interacting with the repositories requesting the required data from the database.
  • Returning the data in the requested form, converting database content to content that the frontend wants to display.