mirror of
https://github.com/ryzij/AMessanger-Server.git
synced 2026-09-18 19:25:38 +00:00
Переместил ChatHub в слой Application
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR" />
|
||||
<PackageReference Include="Newtonsoft.Json" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using AMessanger.Core.Models;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace AMessanger.Core.Hubs;
|
||||
|
||||
public class ChatHub(ILogger<ChatHub> logger) : Hub
|
||||
{
|
||||
public async Task SendMessage(Message message)
|
||||
{
|
||||
logger.LogInformation($"{message.UserName}: {message.Content}");
|
||||
await Clients.All.SendAsync("ReceiveMessage", message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user