using AsbCloudApp.Data;
using AsbCloudApp.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Services.WellReport;
using Microsoft.AspNetCore.Http;
using System;
using AsbCloudApp.Repositories;
using System.Linq;
using AsbCloudApp.Requests;
using AsbCloudInfrastructure.Services;
namespace AsbCloudWebApi.Controllers;
///
///
///
[Route("api/[controller]")]
[ApiController]
//[Authorize]
public class ServiceOperationController : ControllerBase
{
private readonly IWellService wellService;
private readonly IDataSaubStatRepository dataSaubStatRepository;
private readonly ITelemetryService telemetryService;
private readonly IDataSaubStatDrillingQualityService dataSaubStatDrillingQualityService;
public ServiceOperationController(
IWellService wellService,
ITelemetryService telemetryService,
IDataSaubStatDrillingQualityService dataSaubStatDrillingQualityService,
IDataSaubStatRepository dataSaubStatRepository)
{
this.wellService = wellService;
this.dataSaubStatRepository = dataSaubStatRepository;
this.telemetryService = telemetryService;
this.dataSaubStatDrillingQualityService = dataSaubStatDrillingQualityService;
}
///
/// Возвращает данные для страницы "Качество"
///
/// Параметры запроса
/// Токен отмены задачи
///
[HttpGet("drillingQuality")]
[Permission]
[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)]
public async Task GetDataSaubStatDrillingQualityAsync(
[FromQuery] DrillingQualityRequest request, CancellationToken token)
{
var result = await dataSaubStatDrillingQualityService.GetStatAsync(request, token);
return Ok(result);
}
}