DD.WellWorkover.Cloud/AsbCloudWebApi/Controllers/SAUB/TelemetryDataSpinController.cs
2024-08-19 10:01:07 +05:00

37 lines
1.2 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);
}
}