DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/DataController.cs

43 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
/// Возвращает данные САУБ по скважине.
/// По умолчанию за последние 10 минут.
/// </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));
}
}
}