Add some initial history APIs

This commit is contained in:
2019-09-06 17:30:01 -04:00
parent 23d1e779c1
commit 1f1f54706c
6 changed files with 67 additions and 2 deletions

View File

@@ -1,7 +1,8 @@
using System;
using ChrisKaczor.HomeMonitor.Weather.Models;
using ChrisKaczor.HomeMonitor.Weather.Models;
using ChrisKaczor.HomeMonitor.Weather.Service.Data;
using ChrisKaczor.HomeMonitor.Weather.Service.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -30,5 +31,11 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
{
return (await _database.GetReadingHistory(start, end)).ToList();
}
[HttpGet("value-history")]
public async Task<ActionResult<List<WeatherValue>>> GetValueHistory(WeatherValueType weatherValueType, DateTimeOffset start, DateTimeOffset end, int bucketMinutes = 2)
{
return (await _database.GetReadingValueHistory(weatherValueType, start, end, bucketMinutes)).ToList();
}
}
}