47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// PC repräsentiert einen Computer in der Datenbank
|
|
type PC struct {
|
|
ID int `json:"id" db:"id"`
|
|
Name string `json:"name" db:"name"`
|
|
MAC string `json:"mac" db:"mac"`
|
|
IP string `json:"ip" db:"ip"`
|
|
CreatedAt time.Time `json:"created_at" db:"updated_at"`
|
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
|
}
|
|
|
|
// CreatePCRequest repräsentiert die Anfrage zum Erstellen eines neuen PCs
|
|
type CreatePCRequest struct {
|
|
Name string `json:"name" binding:"required"`
|
|
MAC string `json:"mac" binding:"required"`
|
|
IP string `json:"ip" binding:"required"`
|
|
}
|
|
|
|
// UpdatePCRequest repräsentiert die Anfrage zum Aktualisieren eines PCs
|
|
type UpdatePCRequest struct {
|
|
Name string `json:"name" binding:"required"`
|
|
MAC string `json:"mac" binding:"required"`
|
|
IP string `json:"ip" binding:"required"`
|
|
}
|
|
|
|
// PCResponse repräsentiert die Antwort für PC-Operationen
|
|
type PCResponse struct {
|
|
Success bool `json:"success"`
|
|
Message string `json:"message,omitempty"`
|
|
PC *PC `json:"pc,omitempty"`
|
|
PCs []PC `json:"pcs,omitempty"`
|
|
}
|
|
|
|
// PCStatus repräsentiert den Online-Status eines PCs
|
|
type PCStatus struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
MAC string `json:"mac"`
|
|
IP string `json:"ip"`
|
|
Online bool `json:"online"`
|
|
}
|