<?php
declare(strict_types=1);

namespace app\listener\chat;

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

/**
 * 消息确认监听器
 */
class ChatMessageAck
{
    private MessageService $messageService;

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

    public function handle(array $data, WebSocket $ws): void
    {
        $this->messageService->acknowledgeMessage($ws, $data);
    }
}
