Add endpoint to get several bucketed values

This commit is contained in:
2019-10-01 18:45:28 -04:00
parent 69b72e1435
commit 0ac5208409
5 changed files with 59 additions and 0 deletions

View File

@@ -37,5 +37,11 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
{
return (await _database.GetReadingValueHistory(weatherValueType, start, end, bucketMinutes)).ToList();
}
[HttpGet("history-grouped")]
public async Task<ActionResult<List<WeatherReadingGrouped>>> GetHistoryGrouped(DateTimeOffset start, DateTimeOffset end, int bucketMinutes = 2)
{
return (await _database.GetReadingHistoryGrouped(start, end, bucketMinutes)).ToList();
}
}
}