added telemetry api calls (#201)

This commit is contained in:
RoyUP9
2021-08-11 15:57:41 +03:00
committed by GitHub
parent 8a8cf4aa77
commit c8e5886a96
13 changed files with 179 additions and 27 deletions

View File

@@ -241,14 +241,7 @@ func DeleteAllEntries(c *gin.Context) {
}
func GetGeneralStats(c *gin.Context) {
sqlQuery := "SELECT count(*) as count, min(timestamp) as min, max(timestamp) as max from mizu_entries"
var result struct {
Count int
Min int
Max int
}
database.GetEntriesTable().Raw(sqlQuery).Scan(&result)
c.JSON(http.StatusOK, result)
c.JSON(http.StatusOK, providers.GetGeneralStats())
}
func GetTappingStatus(c *gin.Context) {