feat: change from Standart Library to echo framework to simplify development
This commit is contained in:
parent
d74046522b
commit
4514ce44a2
6 changed files with 254 additions and 275 deletions
|
|
@ -1,8 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
import "time"
|
||||
|
||||
type TimeEntry struct {
|
||||
ID int `json:"id"`
|
||||
|
|
@ -10,10 +8,10 @@ type TimeEntry struct {
|
|||
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
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Username string `json:"username"` // Neu - für Join
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type WeeklyHours struct {
|
||||
|
|
@ -33,25 +31,16 @@ type User struct {
|
|||
|
||||
type Schedule struct {
|
||||
ID int `json:"id"`
|
||||
DayOfWeek int `json:"day_of_week"` // 0=Monday, 4=Friday
|
||||
DayOfWeek int `json:"day_of_week"`
|
||||
StartTime string `json:"start_time"`
|
||||
EndTime string `json:"end_time"`
|
||||
Type string `json:"type"` // "lesson" or "break"
|
||||
Type string `json:"type"`
|
||||
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 LoginRequest struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
|
|
@ -59,3 +48,16 @@ type LoginResponse struct {
|
|||
Username string `json:"username"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
}
|
||||
|
||||
type CreateUserRequest struct {
|
||||
Username string `json:"username" validate:"required"`
|
||||
Password string `json:"password" validate:"required,min=6"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
}
|
||||
|
||||
// Claims für JWT
|
||||
type Claims struct {
|
||||
UserID int `json:"user_id"`
|
||||
Username string `json:"username"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue