Moved the webapp to a webpack with some typescript, updated server wtih new endpoints

This commit is contained in:
Daniel Ledda
2020-11-14 01:06:29 +01:00
parent 6dba158ff0
commit 4e57a8eb47
21 changed files with 11118 additions and 20964 deletions

View File

@@ -13,16 +13,23 @@ type SnapshotPayload struct {
type SnapshotRecord struct {
Id int `json:"id"`
SnapshotSubmission
JsonSnapshotSubmission
}
type SnapshotSubmission struct {
type JsonSnapshotSubmission struct {
Timestamp string `json:"time"`
Temp float32 `json:"temp"`
Humidity float32 `json:"humidity"`
Co2 float32 `json:"co2"`
}
type SnapshotSubmission struct {
Timestamp interface{}
Temp interface{}
Humidity interface{}
Co2 interface{}
}
func createSnapshotSubFromJsonBodyStream(jsonBodyStream io.ReadCloser) (*SnapshotSubmission, error) {
var snapshotSub SnapshotSubmission
body, err := ioutil.ReadAll(jsonBodyStream)