<?php
declare (strict_types = 1);

namespace app\listener\space;


use app\services\process\ResetNumberTabService;
use freedom\utils\SocketSession;
use think\swoole\Websocket;

class ResetNumberTab
{
    /**
     * 事件监听处理
     *
     * @return void
     */
    public function handle(array $event, Websocket $ws)
    {
        $res = SocketSession::preliminaryCheck($event,'space');
        if ($res['status'] == true){
            $tableInfo = $res['data'];
            ResetNumberTabService::resetNumberTabService($tableInfo);
        }else{
            $ws->emit('resetNumberTab', ['status' => false, 'msg' => $res['msg']]);
        }
    }
}
