19 lines
439 B
C#
19 lines
439 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
namespace QMax.Api.Infrastructure.Hubs;
|
|
|
|
[Authorize]
|
|
public sealed class QMaxHub : Hub
|
|
{
|
|
public Task JoinChat(string chatId)
|
|
{
|
|
return Groups.AddToGroupAsync(Context.ConnectionId, $"chat:{chatId}");
|
|
}
|
|
|
|
public Task LeaveChat(string chatId)
|
|
{
|
|
return Groups.RemoveFromGroupAsync(Context.ConnectionId, $"chat:{chatId}");
|
|
}
|
|
}
|