mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00

- clean up testdata, serializers and responses - add validators for dashboards - revise documentation of dashboard endpoints for swaggo - revise endpoint implementations
69 lines
1.9 KiB
Go
69 lines
1.9 KiB
Go
package common
|
|
|
|
import "github.com/jinzhu/gorm/dialects/postgres"
|
|
|
|
type WidgetResponse struct {
|
|
ID uint `json:"id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
Width uint `json:"width"`
|
|
Height uint `json:"height"`
|
|
MinWidth uint `json:"minWidth"`
|
|
MinHeight uint `json:"minHeight"`
|
|
X int `json:"x"`
|
|
Y int `json:"y"`
|
|
Z int `json:"z"`
|
|
DashboardID uint `json:"dashboardID"`
|
|
IsLocked bool `json:"isLocked"`
|
|
CustomProperties postgres.Jsonb `json:"customProperties"`
|
|
}
|
|
|
|
type FileResponse struct {
|
|
Name string `json:"name"`
|
|
ID uint `json:"id"`
|
|
Type string `json:"type"`
|
|
Size uint `json:"size"`
|
|
ImageWidth uint `json:"imageHeight"`
|
|
ImageHeight uint `json:"imageWidth"`
|
|
Date string `json:"date"`
|
|
WidgetID uint `json:"widgetID"`
|
|
SimulationModelID uint `json:"simulationModelID"`
|
|
}
|
|
|
|
type SignalResponse struct {
|
|
Name string `json:"name"`
|
|
Unit string `json:"unit"`
|
|
Index uint `json:"index"`
|
|
Direction string `json:"direction"`
|
|
SimulationModelID uint `json:"simulationModelID"`
|
|
}
|
|
|
|
// Response messages
|
|
|
|
type ResponseMsg struct {
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type ResponseMsgSignals struct {
|
|
Signals []SignalResponse `json:"signals"`
|
|
}
|
|
|
|
type ResponseMsgSignal struct {
|
|
Signal SignalResponse `json:"signal"`
|
|
}
|
|
|
|
type ResponseMsgWidgets struct {
|
|
Widgets []WidgetResponse `json:"widgets"`
|
|
}
|
|
|
|
type ResponseMsgWidget struct {
|
|
Widget WidgetResponse `json:"widget"`
|
|
}
|
|
|
|
type ResponseMsgFiles struct {
|
|
Files []FileResponse `json:"files"`
|
|
}
|
|
|
|
type ResponseMsgFile struct {
|
|
File FileResponse `json:"file"`
|
|
}
|