Compare commits
2 Commits
fb3705690d
...
1ca64702d7
Author | SHA1 | Date | |
---|---|---|---|
|
1ca64702d7 | ||
|
6cb36947cb |
@ -45,8 +45,19 @@ namespace Api.Controllers
|
||||
// Sends the deviceId to deviceLogic
|
||||
[Authorize]
|
||||
[HttpGet("logs/{deviceId}")]
|
||||
public async Task<IActionResult> GetLogs([FromBody] DateTimeRange dateTimeRange, int deviceId)
|
||||
public async Task<IActionResult> GetLogs(int deviceId, DateTime? dateTimeStart = null, DateTime? dateTimeEnd = null)
|
||||
{
|
||||
DateTimeRange dateTimeRange = new DateTimeRange();
|
||||
if (dateTimeStart != null && dateTimeEnd != null)
|
||||
{
|
||||
dateTimeRange.DateTimeStart = (DateTime)dateTimeStart;
|
||||
dateTimeRange.DateTimeEnd= (DateTime)dateTimeEnd;
|
||||
}
|
||||
else
|
||||
{
|
||||
dateTimeRange.DateTimeStart = DateTime.Now;
|
||||
dateTimeRange.DateTimeEnd = dateTimeRange.DateTimeStart;
|
||||
}
|
||||
return await _deviceLogic.GetLogs(dateTimeRange, deviceId);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user