mirror of
https://github.com/kaaninchen/Laterna.git
synced 2026-09-17 19:12:48 +00:00
i did a lot of work, and i also forgot to add commits regularly. I added the controller routes to create and delete controllers, improved error handling und improved the authentification process. I'm gonna add an websocket next and then I should be hopefully done with the foundations of this project. I may also add anviewControllers route which respons with every available controller
40 lines
796 B
Go
40 lines
796 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type HTTPConfig struct {
|
|
AdminToken string `json:"adminToken"`
|
|
Port int `json:"port"`
|
|
Cooldown float64 `json:"cooldown"`
|
|
}
|
|
|
|
|
|
type Config struct {
|
|
HTTP HTTPConfig `json:"http"`
|
|
FileLogging bool `json:"fileLogging"`
|
|
VerboseLogging bool `json:"verboseLogging"`
|
|
}
|
|
|
|
type HTTPResponse struct {
|
|
Timestamp string `json:"timestamp"`
|
|
Status int `json:"status"`
|
|
Text string `json:"text"`
|
|
Message string `json:"message"`
|
|
Path string `json:"path"`
|
|
}
|
|
|
|
type LampState struct {
|
|
ID int `json:"id"`
|
|
Color string `json:"color"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type LampUpdateRequest struct {
|
|
Color string `json:"color"`
|
|
}
|
|
|
|
type ControllerRequests struct {
|
|
ID int `json:"ID"`
|
|
} |