From 13a876c8937dfd5fba2596aa7e2de6015a13cd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Sat, 11 Nov 2023 19:12:07 +0100 Subject: [PATCH] Include Working Status in Frontend Dashboard --- .../api/controller/StatisticController.java | 4 +- openapi.yaml | 46 ++++++++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/backend/src/main/java/core/api/controller/StatisticController.java b/backend/src/main/java/core/api/controller/StatisticController.java index 7d3be25..5abfe02 100644 --- a/backend/src/main/java/core/api/controller/StatisticController.java +++ b/backend/src/main/java/core/api/controller/StatisticController.java @@ -24,8 +24,8 @@ public class StatisticController { @Autowired private TaskScheduleService taskScheduleService; - @GetMapping("/history/todayStatus") - public ResponseEntity loadStatusOfToday() { + @GetMapping("/history/workingStatus") + public ResponseEntity getWorkingStatus() { boolean missedSchedules = !taskScheduleService.getAllMissedSchedulesOfUser(SecurityContextHolder.getContext().getAuthentication().getName()).isEmpty(); List executedSchedules = taskScheduleService.getActiveSchedulesOfToday(SecurityContextHolder.getContext().getAuthentication().getName()); int activeTime = 0; diff --git a/openapi.yaml b/openapi.yaml index bf0dad5..ecc7e78 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1626,28 +1626,7 @@ paths: schema: type: object $ref: "#/components/schemas/SimpleStatusResponse" - /schedules/status/today: - get: - security: - - API_TOKEN: [] - tags: - - schedule - description: get number of worked minutes today - summary: get number of active minutes - responses: - 200: - description: operation successfull - content: - application/json: - schema: - $ref: '#/components/schemas/ScheduleStatus' - 404: - description: User not found - content: - 'application/json': - schema: - type: object - $ref: "#/components/schemas/SimpleStatusResponse" + /schedules/{taskID}/forgotten: post: security: @@ -1758,6 +1737,29 @@ paths: application/json: schema: $ref: '#/components/schemas/SimpleStatusResponse' + /history/workingStatus: + get: + security: + - API_TOKEN: [] + tags: + - history + description: get number of worked minutes today + summary: get number of active minutes + responses: + 200: + description: operation successfull + content: + application/json: + schema: + $ref: '#/components/schemas/ScheduleStatus' + 404: + description: User not found + content: + 'application/json': + schema: + type: object + $ref: "#/components/schemas/SimpleStatusResponse" + components: securitySchemes: API_TOKEN: