feat(api,core,domain): RobotSnapshot - почасовой отчет о загрузке роботов
This commit is contained in:
@@ -10,9 +10,11 @@ using PARR.Core.Common.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces;
|
||||
using PARR.Core.Repositories.Interfaces.Unit;
|
||||
using PARR.Core.Services.NextRunServices;
|
||||
using PARR.Core.Services.RobotSnapshotServices;
|
||||
using PARR.Core.Services.UnitService.Interfaces;
|
||||
using PARR.Core.Services.Workload.Implementations;
|
||||
using PARR.Domain.Cache;
|
||||
using PARR.Domain.DTOs.RobotSnapshotDTO;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
{
|
||||
@@ -27,6 +29,7 @@ namespace PARR.API.Controllers.V1
|
||||
private readonly ILogger<TestController> logger;
|
||||
private readonly IUnitService unitService;
|
||||
private readonly IUnitRepository unitRepository;
|
||||
private readonly IRobotSnapshotService _robotSnapshotService;
|
||||
|
||||
public TestController(
|
||||
IClientService clientService,
|
||||
@@ -37,7 +40,8 @@ namespace PARR.API.Controllers.V1
|
||||
WorkloadCacheService workloadCacheService,
|
||||
ILogger<TestController> logger,
|
||||
IUnitService unitService,
|
||||
IUnitRepository unitRepository
|
||||
IUnitRepository unitRepository,
|
||||
IRobotSnapshotService robotSnapshotService
|
||||
)
|
||||
{
|
||||
this.clientService = clientService;
|
||||
@@ -48,6 +52,7 @@ namespace PARR.API.Controllers.V1
|
||||
this.logger = logger;
|
||||
this.unitService = unitService;
|
||||
this.unitRepository = unitRepository;
|
||||
_robotSnapshotService = robotSnapshotService;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +166,22 @@ namespace PARR.API.Controllers.V1
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Тестовый метод
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet(ApiRoutes.Test.TestHandler)]
|
||||
public async Task<IActionResult> Test()
|
||||
{
|
||||
var data = await _robotSnapshotService.GetHourlyAnalyticsAsync(new RobotAnalyticsQuery
|
||||
{
|
||||
DateStart = DateTimeOffset.UtcNow.AddHours(-1),
|
||||
DateEnd = DateTimeOffset.UtcNow,
|
||||
Offset = TimeSpan.FromMinutes(600)
|
||||
});
|
||||
|
||||
return Ok(data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user