Moved the webapp to a webpack with some typescript, updated server wtih new endpoints
This commit is contained in:
11
Snapshot.go
11
Snapshot.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user