From 018c5c026be4a5bdd2fee1144f978dd3d6ba072a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Wed, 6 Dec 2023 17:55:19 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20API=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D0=B5=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80=D1=83?= =?UTF-8?q?=D0=BA=D1=86=D0=B8=D0=B8=20=D1=81=D0=BA=D0=B2=D0=B0=D0=B6=D0=B8?= =?UTF-8?q?=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WellSections/WellSectionPlanController.cs | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/AsbCloudWebApi/Controllers/WellSections/WellSectionPlanController.cs b/AsbCloudWebApi/Controllers/WellSections/WellSectionPlanController.cs index 68167edb..3fd21c68 100644 --- a/AsbCloudWebApi/Controllers/WellSections/WellSectionPlanController.cs +++ b/AsbCloudWebApi/Controllers/WellSections/WellSectionPlanController.cs @@ -113,7 +113,7 @@ public class WellSectionPlanController : ControllerBase /// Идентификатор скважины /// /// - [HttpGet] + [HttpGet("wellSectionTypes")] [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status403Forbidden)] @@ -128,7 +128,29 @@ public class WellSectionPlanController : ControllerBase return Ok(wellSectionTypes); } - + + /// + /// Получить список секций + /// + /// Идентификатор скважины + /// + /// + [HttpGet] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + public async Task GetPlanWellSectionsAsync(int idWell, CancellationToken cancellationToken) + { + await AssertUserAccessToWell(idWell, cancellationToken); + + var planWellSections = await wellSectionPlanRepository.GetByIdWellAsync(idWell, cancellationToken); + + if (!planWellSections.Any()) + return NoContent(); + + return Ok(planWellSections); + } + /// /// Удалить секцию ///