2021-04-07 18:01:56 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
|
|
|
|
using AsbCloudApp.Services;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Контроллер сбора данных от буровых
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Route("api/well")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Authorize]
|
|
|
|
|
public class DataController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly ITelemetryDataService telemetryDataService;
|
|
|
|
|
|
|
|
|
|
public DataController(ITelemetryDataService telemetryDataService)
|
|
|
|
|
{
|
|
|
|
|
this.telemetryDataService = telemetryDataService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-04-09 17:59:07 +05:00
|
|
|
|
/// Возвращает данные САУБ по скважине.
|
|
|
|
|
/// По умолчанию за последние 10 минут.
|
2021-04-07 18:01:56 +05:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="wellId"></param>
|
|
|
|
|
/// <param name=""></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("{wellId}/data")]
|
|
|
|
|
[ProducesResponseType(typeof(IEnumerable<DataSaubBaseDto>), (int)System.Net.HttpStatusCode.OK)]
|
|
|
|
|
public IActionResult Get(int wellId)
|
|
|
|
|
{
|
|
|
|
|
return Ok(telemetryDataService.Get(wellId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|