프론트 테스트 머지 #2

Merged
seonkyu.kim merged 4 commits from Academy into main 2025-05-19 06:46:26 +00:00
2 changed files with 44 additions and 34 deletions
Showing only changes of commit 2b37dc2746 - Show all commits

View File

@ -1,15 +1,14 @@
using Microsoft.AspNetCore.SignalR;
namespace Back.Program.Common.Chat
namespace Back.Program.Common.Chat;
public class ChatHub : Hub
{
public class ChatHub : Hub
{
// 클라이언트에서 메시지를 보내면 모든 사용자에게 전송
public async Task SendMessage(string user, string message)
{
Console.WriteLine($"Message received: {user}: {message}");
await Clients.All.SendAsync("ReceiveMessage", user, message);
}
// 특정 사용자에게 메시지를 보냄
@ -33,10 +32,15 @@ namespace Back.Program.Common.Chat
Console.WriteLine("OnDisconnectedAsync");
await base.OnDisconnectedAsync(exception);
}
public async Task JoinRoom(string cid)
{
await Groups.AddToGroupAsync(Context.ConnectionId, cid);
}
public async Task JoinGroup(string cid, string groupName)
{
await Groups.AddToGroupAsync(Context.ConnectionId, groupName);
}
}
/*
*/

View File

@ -0,0 +1,6 @@
namespace Back.Program.Controllers.V1;
public class ChatController
{
}