feat(api, core): Workload - статус формирования отчетности. RedisCacheService - получить первую запись из кэш типа Hash.
This commit is contained in:
@@ -70,8 +70,6 @@ namespace PARR.API.Controllers.V1.Statistics
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Сформировать отчетность
|
||||
/// </summary>
|
||||
@@ -110,6 +108,22 @@ namespace PARR.API.Controllers.V1.Statistics
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить информацию о формировании КЭШ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet(ApiRoutes.Workload.ReportInfo)]
|
||||
public async Task<IActionResult> GetReportInfo()
|
||||
{
|
||||
var report = await workloadService.GetReportInfoAsync();
|
||||
|
||||
var response = mapper.Map<StatWorkloadCacheInfoResponse>(report);
|
||||
|
||||
return Ok(new Response<StatWorkloadCacheInfoResponse>(response, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Универсальный метод получения отчетности
|
||||
/// </summary>
|
||||
@@ -123,7 +137,8 @@ namespace PARR.API.Controllers.V1.Statistics
|
||||
var report = await workloadService.GetWorkloadReport(reportType, dateStart, durationDays, offset, filter);
|
||||
|
||||
if (report == null)
|
||||
return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { Message = "Необходимо сформировать отчетность." } }));
|
||||
//return BadRequest(new Response(false, new List<ErrorModel> { new ErrorModel { Message = "Необходимо сформировать отчетность." } }));
|
||||
return BadRequest(new Response<string?>(null, false, new List<ErrorModel> { new ErrorModel { Message = "Необходимо сформировать отчетность." } }, "empty"));
|
||||
|
||||
var resonse = mapper.Map<StatWorkloadReportResponse>(report);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user