Add staff playtime feature, including backend services, API endpoint, and frontend integration.

WIP
This commit is contained in:
2025-11-02 22:25:10 +01:00
parent 2be79c180a
commit 8b0d2f9203
18 changed files with 321 additions and 0 deletions
+5
View File
@@ -63,6 +63,11 @@ tasks.register< GenerateTask>("generateJavaApi") {
typeMappings.put("OffsetDateTime", "Instant")
importMappings.put("java.time.OffsetDateTime", "java.time.Instant")
modelNameSuffix.set("Dto")
// Make generator use Java 8 time types and map date-time -> Instant
additionalProperties.set(mapOf("dateLibrary" to "java8"))
typeMappings.set(mapOf("date-time" to "Instant"))
importMappings.set(mapOf("Instant" to "java.time.Instant"))
generateModelTests.set(false)
generateModelDocumentation.set(false)
generateApiTests.set(false)
+2
View File
@@ -93,3 +93,5 @@ paths:
$ref: './schemas/forms/mail/mail.yml#/GetEmails'
/api/site/vote:
$ref: './schemas/site/vote.yml#/VoteStats'
/api/site/get-staff-playtime/{from}/{to}:
$ref: './schemas/site/staff_pt.yml#/GetStaffPlaytime'
@@ -0,0 +1,53 @@
GetStaffPlaytime:
get:
tags:
- site
summary: Get staff playtime for a specified duration
description: Get staff playtime for all staff members for a specified duration
operationId: getStaffPlaytime
parameters:
- $ref: '#/components/parameters/From'
- $ref: '#/components/parameters/To'
responses:
'200':
description: Staff playtime retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/StaffPlaytimeList'
components:
parameters:
From:
name: from
in: path
required: true
schema:
type: string
format: date-time
example: 2025-01-01T00:00:00.000Z
To:
name: to
in: path
required: true
schema:
type: string
format: date-time
example: 2025-01-07T23:59:59.999Z
schemas:
StaffPlaytimeList:
type: array
items:
$ref: '#/components/schemas/StaffPlaytime'
StaffPlaytime:
type: object
properties:
staff_member:
type: string
description: The name of the staff member
playtime:
type: integer
description: Total playtime for the specified duration in minutes
last_played:
type: string
format: date-time
description: Last played timestamp