using AsbCloudApp.Data.Trajectory;
using AsbCloudApp.Repositories;
using AsbCloudApp.Services;
using AsbCloudInfrastructure.Services.Trajectory;
using AsbCloudInfrastructure.Services.Trajectory.Import;
using AsbCloudInfrastructure.Services.Trajectory.Export;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers.Trajectory
{
///
/// Плановая траектория (загрузка и хранение)
///
[Route("api/well/{idWell}/[controller]")]
[ApiController]
public class TrajectoryPlanController : TrajectoryEditableController
{
private readonly TrajectoryService trajectoryVisualizationService;
public TrajectoryPlanController(IWellService wellService,
TrajectoryPlanParserService trajectoryPlanImportService,
TrajectoryPlanExportService trajectoryPlanExportService,
ITrajectoryEditableRepository trajectoryPlanRepository,
TrajectoryService trajectoryVisualizationService)
: base(
wellService,
trajectoryPlanImportService,
trajectoryPlanExportService,
trajectoryPlanRepository)
{
fileName = "ЕЦП_шаблон_файла_плановая_траектория.xlsx";
this.trajectoryVisualizationService = trajectoryVisualizationService;
}
///
/// Получение координат для визуализации траектории (плановой и фактической)
///
///
///
///
[HttpGet("trajectoryCartesianPlanFact")]
[ProducesResponseType(typeof(TrajectoryPlanFactDto, IEnumerable>), (int)System.Net.HttpStatusCode.OK)]
public async Task GetTrajectoryCartesianPlanFactAsync(int idWell, CancellationToken token)
{
if (!await CanUserAccessToWellAsync(idWell,
token).ConfigureAwait(false))
return Forbid();
var result = await trajectoryVisualizationService.GetTrajectoryCartesianAsync(idWell, token);
return Ok(result);
}
}
}