forked from ddrilling/AsbCloudServer
60 lines
2.2 KiB
C#
60 lines
2.2 KiB
C#
|
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;
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
[Route("api/[controller]")]
|
||
|
[ApiController]
|
||
|
//[Authorize]
|
||
|
public class ServiceOperationController : ControllerBase
|
||
|
{
|
||
|
private readonly IWellService wellService;
|
||
|
private readonly IDataSaubStatRepository<DataSaubStatDrillingQualityDto> dataSaubStatRepository;
|
||
|
private readonly ITelemetryService telemetryService;
|
||
|
private readonly IDataSaubStatDrillingQualityService dataSaubStatDrillingQualityService;
|
||
|
|
||
|
public ServiceOperationController(
|
||
|
IWellService wellService,
|
||
|
ITelemetryService telemetryService,
|
||
|
IDataSaubStatDrillingQualityService dataSaubStatDrillingQualityService,
|
||
|
IDataSaubStatRepository<DataSaubStatDrillingQualityDto> dataSaubStatRepository)
|
||
|
{
|
||
|
this.wellService = wellService;
|
||
|
this.dataSaubStatRepository = dataSaubStatRepository;
|
||
|
this.telemetryService = telemetryService;
|
||
|
this.dataSaubStatDrillingQualityService = dataSaubStatDrillingQualityService;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// Возвращает данные для страницы "Качество"
|
||
|
/// </summary>
|
||
|
/// <param name="request">Параметры запроса</param>
|
||
|
/// <param name="token"> Токен отмены задачи </param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet("drillingQuality")]
|
||
|
[Permission]
|
||
|
[ProducesResponseType(typeof(IEnumerable<DrillingQualityDto>), (int)System.Net.HttpStatusCode.OK)]
|
||
|
public async Task<IActionResult> GetDataSaubStatDrillingQualityAsync(
|
||
|
[FromQuery] DrillingQualityRequest request, CancellationToken token)
|
||
|
{
|
||
|
var result = await dataSaubStatDrillingQualityService.GetStatAsync(request, token);
|
||
|
return Ok(result);
|
||
|
}
|
||
|
}
|