DD.WellWorkover.Cloud/AsbCloudWebApi/WebSocket/TelemetryHub.cs

22 lines
643 B
C#
Raw Normal View History

2021-04-08 17:54:02 +05:00
using AsbCloudApp.Data;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;
namespace AsbCloudWebApi.WebSocket
{
[Authorize]
public class TelemetryHub : Hub<ITelemetryHubClient>
{
public Task AddToGroup(string groupName)
=> Groups.AddToGroupAsync(Context.ConnectionId, groupName.ToString());
public Task RemoveFromGroup(string groupName)
=> Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
public Task SendDataSaub(int wellId, DataSaubBaseDto data)
=> Clients.All.ReceiveDataSaub(data);
}
}