remodel json data for compatibility

This commit is contained in:
Adrian Zürcher
2025-04-26 23:14:50 +02:00
parent 85bd8de2a2
commit ea4719ff01
26 changed files with 672 additions and 550 deletions

27
models/get.go Normal file
View File

@@ -0,0 +1,27 @@
package models
import "github.com/google/uuid"
type Get struct {
Uuid uuid.UUID `json:"uuid"`
Path string `json:"path"`
Query *Query `json:"query,omitempty"`
Drivers *Drivers `json:"driver,omitempty"`
Type Type `json:"type,omitempty"`
Value any `json:"value,omitempty"`
Rights Rights `json:"rights,omitempty"`
}
func (g *Get) ByPath(path string, query *Query) {
g.Path = path
if query != nil {
g.Query = query
}
}
func (g *Get) ByUuid(uid string, query *Query) {
g.Uuid = uuid.MustParse(uid)
if query != nil {
g.Query = query
}
}