Include Working Status in Frontend Dashboard
All checks were successful
Java CI with Maven / build (push) Successful in 48s

This commit is contained in:
Sebastian Böckelmann 2023-11-11 19:12:07 +01:00
parent d7850a9aa7
commit 13a876c893
2 changed files with 26 additions and 24 deletions

View File

@ -24,8 +24,8 @@ public class StatisticController {
@Autowired private TaskScheduleService taskScheduleService; @Autowired private TaskScheduleService taskScheduleService;
@GetMapping("/history/todayStatus") @GetMapping("/history/workingStatus")
public ResponseEntity<?> loadStatusOfToday() { public ResponseEntity<?> getWorkingStatus() {
boolean missedSchedules = !taskScheduleService.getAllMissedSchedulesOfUser(SecurityContextHolder.getContext().getAuthentication().getName()).isEmpty(); boolean missedSchedules = !taskScheduleService.getAllMissedSchedulesOfUser(SecurityContextHolder.getContext().getAuthentication().getName()).isEmpty();
List<AbstractSchedule> executedSchedules = taskScheduleService.getActiveSchedulesOfToday(SecurityContextHolder.getContext().getAuthentication().getName()); List<AbstractSchedule> executedSchedules = taskScheduleService.getActiveSchedulesOfToday(SecurityContextHolder.getContext().getAuthentication().getName());
int activeTime = 0; int activeTime = 0;

View File

@ -1626,28 +1626,7 @@ paths:
schema: schema:
type: object type: object
$ref: "#/components/schemas/SimpleStatusResponse" $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: /schedules/{taskID}/forgotten:
post: post:
security: security:
@ -1758,6 +1737,29 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/SimpleStatusResponse' $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: components:
securitySchemes: securitySchemes:
API_TOKEN: API_TOKEN: