Рефакторинг изменений

Добавленный метод удаления в предыдущем коммите, являлся избыточным.
This commit is contained in:
parent b58cd2d636
commit 1d2b81b724
3 changed files with 0 additions and 29 deletions

View File

@ -17,14 +17,5 @@ namespace AsbCloudApp.Services
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ProcessMapReportDto>> GetProcessMapReportAsync(int idWell, CancellationToken token);
/// <summary>
/// Удаление записи РТК
/// </summary>
/// <param name="id"></param>
/// <param name="idWell"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> DeleteAsync(int id, int idWell, CancellationToken token);
}
}

View File

@ -54,16 +54,6 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
return result;
}
public async Task<int> DeleteAsync(int id, int idWell, CancellationToken token)
{
var processMap = await processMapPlanRepository.GetOrDefaultAsync(id, token);
if (processMap?.IdWell != idWell)
throw new ArgumentInvalidException("Запись РТК принадлежит другой скважине", nameof(idWell));
return await processMapPlanRepository.DeleteAsync(id, token);
}
private IEnumerable<ProcessMapReportDto> CalcByIntervals(IEnumerable<ProcessMapPlanDto> processMapPlan, TelemetryDataSaubStatDto[] telemetryDataStat)
{
var processMapIntervals = CalcDepthIntervals(processMapPlan);

View File

@ -250,16 +250,6 @@ namespace AsbCloudWebApi.Controllers
var fileName = $"РТК-план по скважине {well.Caption} куст {well.Cluster}.xlsx";
return File(stream, "application/octet-stream", fileName);
}
[HttpDelete("{id}/{idWell}")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<ActionResult<int>> DeleteAsync(int id, int idWell, CancellationToken cancellationToken)
{
if (!await CanUserEditProcessMapAsync(idWell, cancellationToken))
return Forbid();
return await processMapService.DeleteAsync(id, idWell, cancellationToken);
}
private async Task<bool> CanUserEditProcessMapAsync(int idWell, CancellationToken token)
{