DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/SAUB/TelemetryDataSpinController.cs

38 lines
1.3 KiB
C#

using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Services;
using AsbCloudWebApi.SignalR;
using AsbCloudWebApi.SignalR.Clients;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers.SAUB
{
/// <summary>
/// Данные осциллятора и демпфера
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class TelemetryDataSpinController : TelemetryDataBaseController<TelemetryDataSpinDto>
{
public TelemetryDataSpinController(
ITelemetryService telemetryService,
ITelemetryDataService<TelemetryDataSpinDto> telemetryDataService,
IWellService wellService,
IHubContext<TelemetryHub, ITelemetryHubClient> telemetryHubContext)
: base(
telemetryService,
telemetryDataService,
wellService,
telemetryHubContext)
{}
protected override Task SignalRNotifyAsync(int idWell, IEnumerable<TelemetryDataSpinDto> dtos, CancellationToken token)
{
return telemetryHubContext.Clients.Group($"well_{idWell}").ReceiveDataSpin(dtos, token);
}
}
}