2023-08-14 18:30:31 +05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using AsbCloudApp.Data;
|
2023-08-15 14:20:28 +05:00
|
|
|
using AsbCloudApp.Services;
|
2023-08-14 18:30:31 +05:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2023-08-15 12:28:39 +05:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2023-08-14 18:30:31 +05:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi.Controllers;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Ствол скважины
|
|
|
|
/// </summary>
|
|
|
|
[Authorize]
|
|
|
|
[ApiController]
|
2023-08-15 17:43:49 +05:00
|
|
|
[Route("api/[controller]")]
|
2023-08-14 18:30:31 +05:00
|
|
|
public class WellboreController : ControllerBase
|
|
|
|
{
|
2024-07-04 11:02:45 +05:00
|
|
|
private readonly IWellboreService wellboreService;
|
2023-08-14 18:30:31 +05:00
|
|
|
|
2024-07-04 11:02:45 +05:00
|
|
|
public WellboreController(IWellboreService wellboreService)
|
|
|
|
{
|
|
|
|
this.wellboreService = wellboreService;
|
|
|
|
}
|
2023-08-14 18:30:31 +05:00
|
|
|
|
2023-10-23 18:06:57 +05:00
|
|
|
/// <summary>
|
|
|
|
/// Получение списка стволов скважин
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="idsWells">Идентификаторы скважин</param>
|
|
|
|
/// <param name="cancellationToken"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet]
|
2024-07-04 11:02:45 +05:00
|
|
|
[ProducesResponseType(typeof(IEnumerable<WellboreDto>), StatusCodes.Status200OK)]
|
|
|
|
public async Task<IActionResult> GetAllAsync([FromQuery] IEnumerable<int> idsWells,
|
|
|
|
CancellationToken cancellationToken)
|
2023-10-23 18:06:57 +05:00
|
|
|
{
|
2024-07-04 11:02:45 +05:00
|
|
|
var result = await wellboreService.GetWellboresAsync(idsWells, cancellationToken);
|
2023-08-14 18:30:31 +05:00
|
|
|
|
2023-10-23 18:06:57 +05:00
|
|
|
return Ok(result);
|
2024-07-04 11:02:45 +05:00
|
|
|
}
|
2023-08-14 18:30:31 +05:00
|
|
|
}
|