From 83507765fbab231e0e5cb20796c584808be8af08 Mon Sep 17 00:00:00 2001 From: Ole Vester Date: Tue, 15 Oct 2024 00:22:10 +0200 Subject: [PATCH] Thanks to the ArchTests --- .../tum/cit/aet/artemis/atlas/web/MetricsResource.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/tum/cit/aet/artemis/atlas/web/MetricsResource.java b/src/main/java/de/tum/cit/aet/artemis/atlas/web/MetricsResource.java index db24d9569c88..533d437ff314 100644 --- a/src/main/java/de/tum/cit/aet/artemis/atlas/web/MetricsResource.java +++ b/src/main/java/de/tum/cit/aet/artemis/atlas/web/MetricsResource.java @@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import de.tum.cit.aet.artemis.atlas.api.LearningMetricsApi; import de.tum.cit.aet.artemis.atlas.dto.metrics.StudentMetricsDTO; -import de.tum.cit.aet.artemis.atlas.service.LearningMetricsService; import de.tum.cit.aet.artemis.core.repository.UserRepository; import de.tum.cit.aet.artemis.core.security.annotations.enforceRoleInCourse.EnforceAtLeastStudentInCourse; @@ -23,12 +23,12 @@ public class MetricsResource { private static final Logger log = LoggerFactory.getLogger(MetricsResource.class); - private final LearningMetricsService learningMetricsService; + private final LearningMetricsApi learningMetricsApi; private final UserRepository userRepository; - public MetricsResource(LearningMetricsService learningMetricsService, UserRepository userRepository) { - this.learningMetricsService = learningMetricsService; + public MetricsResource(LearningMetricsApi learningMetricsApi, UserRepository userRepository) { + this.learningMetricsApi = learningMetricsApi; this.userRepository = userRepository; } @@ -43,7 +43,7 @@ public MetricsResource(LearningMetricsService learningMetricsService, UserReposi public ResponseEntity getCourseMetricsForUser(@PathVariable long courseId) { final var userId = userRepository.getUserIdElseThrow(); // won't throw exception since EnforceRoleInResource checks existence of user log.debug("REST request to get the metrics for the user with id {} in the course with id {}", userId, courseId); - final var studentMetrics = learningMetricsService.getStudentCourseMetrics(userId, courseId); + final var studentMetrics = learningMetricsApi.getStudentCourseMetrics(userId, courseId); return ResponseEntity.ok(studentMetrics); } }