Merge branch 'fix/rest_response'
fix(gateway): update field handling to include value type See merge request team-raclette/project-softweng!10
This commit is contained in:
@@ -85,11 +85,12 @@ func (gh *Gateway) requestInflux(c *gin.Context) error {
|
|||||||
field := record.Field()
|
field := record.Field()
|
||||||
value := record.Value()
|
value := record.Value()
|
||||||
m["time"] = record.Time()
|
m["time"] = record.Time()
|
||||||
|
m["value"] = value.(float64)
|
||||||
if field == "temperature" {
|
if field == "temperature" {
|
||||||
m["temperature"] = value.(float64)
|
m["type"] = "temperature"
|
||||||
}
|
}
|
||||||
if field == "humidity" {
|
if field == "humidity" {
|
||||||
m["humidity"] = value.(float64)
|
m["type"] = "humidity"
|
||||||
}
|
}
|
||||||
values = append(values, m)
|
values = append(values, m)
|
||||||
fmt.Println(results.Record())
|
fmt.Println(results.Record())
|
||||||
|
|||||||
Reference in New Issue
Block a user