2021-07-21 15:29:19 +05:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2021-05-20 11:07:45 +05:00
|
|
|
|
using Microsoft.AspNetCore.SignalR;
|
2021-07-21 15:29:19 +05:00
|
|
|
|
using System.Threading.Tasks;
|
2021-05-20 11:07:45 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudWebApi.SignalR
|
|
|
|
|
{
|
|
|
|
|
// SignalR manual:
|
|
|
|
|
// https://docs.microsoft.com/ru-ru/aspnet/core/signalr/introduction?view=aspnetcore-5.0
|
|
|
|
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
public class ReportsHub : Hub<IReportHubClient>
|
|
|
|
|
{
|
2021-06-07 16:31:14 +05:00
|
|
|
|
public Task AddToGroup(string groupName)
|
|
|
|
|
=> Groups.AddToGroupAsync(Context.ConnectionId, groupName);
|
2021-05-20 11:07:45 +05:00
|
|
|
|
|
2021-06-07 16:31:14 +05:00
|
|
|
|
public Task RemoveFromGroup(string groupName)
|
|
|
|
|
=> Groups.RemoveFromGroupAsync(Context.ConnectionId, groupName);
|
2021-05-20 11:07:45 +05:00
|
|
|
|
}
|
|
|
|
|
}
|