mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
Add initial history API
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using ChrisKaczor.HomeMonitor.Weather.Models;
|
||||
using System;
|
||||
using ChrisKaczor.HomeMonitor.Weather.Models;
|
||||
using ChrisKaczor.HomeMonitor.Weather.Service.Data;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
||||
@@ -21,5 +24,11 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Controllers
|
||||
{
|
||||
return await _database.GetRecentReading();
|
||||
}
|
||||
|
||||
[HttpGet("history")]
|
||||
public async Task<ActionResult<List<WeatherReading>>> GetHistory(DateTimeOffset start, DateTimeOffset end)
|
||||
{
|
||||
return (await _database.GetReadingHistory(start, end)).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user