feat: add Logging Middleware, saving Token and better Handling

This commit is contained in:
Patryk Hegenberg 2025-11-05 07:16:38 +01:00
parent 2c4fc7869a
commit d74046522b
8 changed files with 926 additions and 236 deletions

View file

@ -4,6 +4,26 @@ import (
"time"
)
type TimeEntry struct {
ID int `json:"id"`
UserID int `json:"user_id"`
ScheduleID int `json:"schedule_id"`
Date string `json:"date"`
Type string `json:"type"`
StartTime string `json:"start_time"` // Neu
EndTime string `json:"end_time"` // Neu
CreatedAt time.Time `json:"created_at"`
Username string `json:"username"` // Neu - für Join
}
type WeeklyHours struct {
UserID int `json:"user_id"`
Username string `json:"username"`
Week int `json:"week"`
Year int `json:"year"`
TotalHours float64 `json:"total_hours"`
}
type User struct {
ID int `json:"id"`
Username string `json:"username"`
@ -20,14 +40,14 @@ type Schedule struct {
Title string `json:"title"`
}
type TimeEntry struct {
ID int `json:"id"`
UserID int `json:"user_id"`
ScheduleID int `json:"schedule_id"`
Date string `json:"date"`
Type string `json:"type"` // "lesson" or "break"
CreatedAt time.Time `json:"created_at"`
}
// type TimeEntry struct {
// ID int `json:"id"`
// UserID int `json:"user_id"`
// ScheduleID int `json:"schedule_id"`
// Date string `json:"date"`
// Type string `json:"type"` // "lesson" or "break"
// CreatedAt time.Time `json:"created_at"`
// }
type LoginRequest struct {
Username string `json:"username"`