Пример #1
0
        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();
        }
Пример #2
0
 public void SendMessage(string text, string userId,string chatRoomId)
 {
     IChatService service = new ChatService();
     service.SendMessage(text, userId, chatRoomId);
 }
Пример #3
0
 public string ReceiveMessages(string userId, string chatRoomId)
 {
     IChatService service = new ChatService();
     return service.ReceiveMessages(userId, chatRoomId);
 }