Добавлен метод API получения секций конструкции скважины

This commit is contained in:
Степанов Дмитрий 2023-12-06 17:55:19 +05:00
parent 3d36779529
commit 018c5c026b

View File

@ -113,7 +113,7 @@ public class WellSectionPlanController : ControllerBase
/// <param name="idWell">Идентификатор скважины</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpGet]
[HttpGet("wellSectionTypes")]
[ProducesResponseType(typeof(IEnumerable<WellSectionTypeDto>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
@ -128,7 +128,29 @@ public class WellSectionPlanController : ControllerBase
return Ok(wellSectionTypes);
}
/// <summary>
/// Получить список секций
/// </summary>
/// <param name="idWell">Идентификатор скважины</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpGet]
[ProducesResponseType(typeof(IEnumerable<WellSectionPlanDto>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public async Task<IActionResult> GetPlanWellSectionsAsync(int idWell, CancellationToken cancellationToken)
{
await AssertUserAccessToWell(idWell, cancellationToken);
var planWellSections = await wellSectionPlanRepository.GetByIdWellAsync(idWell, cancellationToken);
if (!planWellSections.Any())
return NoContent();
return Ok(planWellSections);
}
/// <summary>
/// Удалить секцию
/// </summary>