forked from ddrilling/AsbCloudServer
42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using AsbCloudApp.Data;
|
|
using AsbCloudApp.Repositories;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace AsbCloudWebApi.Controllers;
|
|
|
|
/// <summary>
|
|
/// Фактическая траектория
|
|
/// </summary>
|
|
[Authorize]
|
|
[ApiController]
|
|
[Route("api/well/{idWell}/[controller]")]
|
|
public class FactTrajectoryController : ControllerBase
|
|
{
|
|
private readonly ITrajectoryFactRepository trajectoryFactRepository;
|
|
|
|
public FactTrajectoryController(ITrajectoryFactRepository trajectoryFactRepository)
|
|
{
|
|
this.trajectoryFactRepository = trajectoryFactRepository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Метод получения всех строк траекторий по id скважины
|
|
/// </summary>
|
|
/// <param name="idWell">Id скважины</param>
|
|
/// <param name="cancellationToken">Токен отмены операции</param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[ProducesResponseType(typeof(IEnumerable<TrajectoryGeoPlanDto>), (int)System.Net.HttpStatusCode.OK)]
|
|
public async Task<IActionResult> GetRowsAsync([FromRoute] int idWell,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
var factTrajectories = await trajectoryFactRepository.GetAsync(idWell,
|
|
cancellationToken);
|
|
|
|
return Ok(factTrajectories);
|
|
}
|
|
} |