mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 01:25:38 -05:00
Add initial device status service
This commit is contained in:
21
DeviceStatus/Service/Controllers/StatusController.cs
Normal file
21
DeviceStatus/Service/Controllers/StatusController.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Service.Controllers
|
||||
{
|
||||
[Route("[controller]")]
|
||||
[ApiController]
|
||||
public class StatusController : ControllerBase
|
||||
{
|
||||
private readonly DeviceRepository _deviceRepository;
|
||||
public StatusController(DeviceRepository deviceRepository)
|
||||
{
|
||||
_deviceRepository = deviceRepository;
|
||||
}
|
||||
|
||||
[HttpGet("recent")]
|
||||
public ActionResult<IEnumerable<Device>> GetRecent()
|
||||
{
|
||||
return _deviceRepository.Values;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user