<?php

namespace app\listener\chat;

use app\services\chat\MessageService;
use think\swoole\WebSocket;

/**
 * 发送消息监听器
 */
class ChatMessageSend
{
    private $messageService;

    public function __construct()
    {
        $this->messageService = new MessageService();
    }

    public function handle(array $event, WebSocket $ws)
    {
        $this->messageService->sendMessage($ws, $event);
    }
}
