DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/WellboreController.cs

42 lines
1.2 KiB
C#
Raw Normal View History

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