static void Main(string[] args) { Core.ChatService chatService = new Core.ChatService("127.0.0.1", 8081); chatService.SetCreateRepositoryFunc(() => new ChatServiceRepository()); chatService.SetGetUidFunc(p => { string uid = p.CookieCollection["UId"].Value; return(Guid.Parse(uid)); }); chatService.Start(); Console.WriteLine("服务已启动"); Console.ReadLine(); }
public void SendMessage(string text, string userId,string chatRoomId) { IChatService service = new ChatService(); service.SendMessage(text, userId, chatRoomId); }
public string ReceiveMessages(string userId, string chatRoomId) { IChatService service = new ChatService(); return service.ReceiveMessages(userId, chatRoomId); }