diff --git a/backend/src/main/java/de/hft/geotime/controllers/UserController.java b/backend/src/main/java/de/hft/geotime/controllers/UserController.java index e5acae4..5f63c4f 100644 --- a/backend/src/main/java/de/hft/geotime/controllers/UserController.java +++ b/backend/src/main/java/de/hft/geotime/controllers/UserController.java @@ -4,6 +4,7 @@ import de.hft.geotime.entities.TimetrackUser; import de.hft.geotime.entities.projections.UserAllEmbeddedProjection; import de.hft.geotime.repositories.TimetrackUserRepository; import org.springframework.data.projection.ProjectionFactory; +import org.springframework.data.rest.webmvc.BasePathAwareController; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; @@ -11,11 +12,12 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.ResponseBody; import java.util.HashMap; -@RestController +@BasePathAwareController +@ResponseBody public class UserController { private final TimetrackUserRepository userRepository; diff --git a/backend/src/main/java/de/hft/geotime/repositories/RecordRepository.java b/backend/src/main/java/de/hft/geotime/repositories/RecordRepository.java index b185c6f..765b6e9 100644 --- a/backend/src/main/java/de/hft/geotime/repositories/RecordRepository.java +++ b/backend/src/main/java/de/hft/geotime/repositories/RecordRepository.java @@ -2,7 +2,16 @@ package de.hft.geotime.repositories; import de.hft.geotime.entities.TimeRecord; import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; -public interface RecordRepository extends CrudRepository { +import java.util.List; + +@RepositoryRestResource( + path = "records", + itemResourceRel = "records", + collectionResourceRel = "records" +) +public interface RecordRepository extends PagingAndSortingRepository { }