yats.git

commit 34e888df1bac1f38c5783c2fa746819f2d10853f

Author: Paolo Lulli <paolo@lulli.net>

Return data content array

 server/rest/rest-event.go | 4 ++--
 server/rest/rest-metric.go | 4 ++--
 server/rest/rest-position.go | 4 ++--


diff --git a/server/rest/rest-event.go b/server/rest/rest-event.go
index a3b6a114486158f8c81bfb27ce3f40c2cf3f068c..93381e8a43f9b206aaf786b89833d648af56d313 100644
--- a/server/rest/rest-event.go
+++ b/server/rest/rest-event.go
@@ -97,7 +97,7 @@ 			fromInBytes, _ := fromUnixTimeUTC.UTC().MarshalText()
 			toInBytes, _ := toUnixTimeUTC.UTC().MarshalText()
 			eventsPack = db.EventsBetween(db.Session, clientCN, string(fromInBytes), string(toInBytes), 100)
 		}
-		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "content": eventsPack})
+		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "data": eventsPack})
 	}
 }
 
@@ -131,6 +131,6 @@ 		unixTimeUTC := time.Unix(fromParamInt64, 0)
 		timeAsBytes, _ := unixTimeUTC.UTC().MarshalText()
 		eventsPack = db.EventsFrom(db.Session, clientCN, string(timeAsBytes), 100)
 
-		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "content": eventsPack})
+		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "data": eventsPack})
 	}
 }




diff --git a/server/rest/rest-metric.go b/server/rest/rest-metric.go
index 0c25f79131990e30bad695beb30c4c0590e035a5..6305c0bdce0d9caaf405e13bcab15b0c24706fac 100644
--- a/server/rest/rest-metric.go
+++ b/server/rest/rest-metric.go
@@ -102,7 +102,7 @@ 			fromInBytes, _ := fromUnixTimeUTC.UTC().MarshalText()
 			toInBytes, _ := toUnixTimeUTC.UTC().MarshalText()
 			metricsPack = db.MetricsBetween(db.Session, clientCN, metric.Name, string(fromInBytes), string(toInBytes), 100)
 		}
-		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "content": metricsPack})
+		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "data": metricsPack})
 	}
 }
 
@@ -138,6 +138,6 @@ 		unixTimeUTC := time.Unix(fromParamInt64, 0)
 		timeAsBytes, _ := unixTimeUTC.UTC().MarshalText()
 		metricsPack = db.MetricsFrom(db.Session, clientCN, nameParam, string(timeAsBytes), 100)
 
-		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "content": metricsPack})
+		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "data": metricsPack})
 	}
 }




diff --git a/server/rest/rest-position.go b/server/rest/rest-position.go
index f431f32484aec8f6900a50ab18356672068d174e..23590f9e5c4a9879854229dce94f112f37a7559f 100644
--- a/server/rest/rest-position.go
+++ b/server/rest/rest-position.go
@@ -87,7 +87,7 @@ 			fromInBytes, _ := fromUnixTimeUTC.UTC().MarshalText()
 			toInBytes, _ := toUnixTimeUTC.UTC().MarshalText()
 			eventsPack = db.EventsBetween(db.Session, clientCN, string(fromInBytes), string(toInBytes), 100)
 		}
-		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "content": eventsPack})
+		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "data": eventsPack})
 	}
 }
 
@@ -121,6 +121,6 @@ 		unixTimeUTC := time.Unix(fromParamInt64, 0)
 		timeAsBytes, _ := unixTimeUTC.UTC().MarshalText()
 		eventsPack = db.EventsFrom(db.Session, clientCN, string(timeAsBytes), 100)
 
-		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "content": eventsPack})
+		c.IndentedJSON(http.StatusAccepted, gin.H{"ret": "OK", "data": eventsPack})
 	}
 }