Add the whole api stack for weight

This commit is contained in:
2024-08-09 23:18:50 +02:00
parent 57d88c093e
commit 1edc3e83ef
11 changed files with 570 additions and 16 deletions

View File

@@ -1,7 +1,5 @@
package main
import "time"
type (
// Wails doesn't rlike generics... Fuck...
// WailsReturn[T interface{}] struct {
@@ -31,18 +29,24 @@ type (
Error string `json:"error,omitempty"`
}
WailsWeight struct {
Data []Weight `json:"data"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
WailsWeight1 struct {
Data Weight `json:"data"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
WailsAggregateWeight struct {
Data []AggregatedWeight `json:"data"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
WailsGenericAck struct {
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
Weight struct {
rowid int
date time.Time
weight float32
}
AggregatedWeight struct {
period string
amount float32
}
)