Удаление метода из API подсистем

Удалён метод получения статистики наработки по активным скважинам. /api/Subsystem/statByActiveWell
This commit is contained in:
Степанов Дмитрий 2024-01-23 09:14:09 +05:00
parent 845a7402b7
commit 72e6c8931b
3 changed files with 1 additions and 39 deletions

View File

@ -19,17 +19,7 @@ public interface ISubsystemService
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<SubsystemStatDto>> GetStatAsync(SubsystemRequest request, CancellationToken token);
/// <summary>
/// Получение статистики по наработке подсистем по активным скважинам
/// </summary>
/// <param name="idCompany"></param>
/// <param name="gtDate"></param>
/// <param name="ltDate"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<SubsystemActiveWellStatDto>> GetStatByActiveWells(int idCompany, DateTime? gtDate, DateTime? ltDate, CancellationToken token);
/// <summary>
/// Получение статистики по наработке подсистем по активным скважинам
/// </summary>

View File

@ -71,16 +71,6 @@ internal class SubsystemService : ISubsystemService
return stat;
}
public async Task<IEnumerable<SubsystemActiveWellStatDto>> GetStatByActiveWells(int idCompany,
DateTime? gtDate,
DateTime? ltDate,
CancellationToken token)
{
var activeWells = await wellService.GetAsync(new() { IdCompany = idCompany, IdState = 1 }, token);
var result = await GetStatAsync(activeWells, gtDate, ltDate, token);
return result;
}
public async Task<IEnumerable<SubsystemActiveWellStatDto>> GetStatByActiveWells(IEnumerable<int> wellIds, CancellationToken token)
{
var activeWells = await wellService.GetAsync(new() { Ids = wellIds, IdState = 1 }, token);

View File

@ -61,24 +61,6 @@ namespace AsbCloudWebApi.Controllers.Subsystems
return Ok(dateRange);
}
/// <summary>
/// получить статистику по активным скважинам
/// </summary>
/// <param name="gtDate"> Больше или равно дате </param>
/// <param name="ltDate"> Меньше или равно дате </param>
/// <param name="token"> Токен </param>
/// <returns> </returns>
[HttpGet("statByActiveWell")]
[ProducesResponseType(typeof(IEnumerable<SubsystemActiveWellStatDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetStatByWellAsync(DateTime? gtDate, DateTime? ltDate, CancellationToken token)
{
var idCompany = User.GetCompanyId();
if (!idCompany.HasValue)
return Forbid();
var subsystemResult = await subsystemService.GetStatByActiveWells(idCompany.Value, gtDate, ltDate, token);
return Ok(subsystemResult);
}
private async Task<bool> UserHasAccessToWellAsync(int idWell, CancellationToken token)
{
var idCompany = User.GetCompanyId();