<?php
declare (strict_types = 1);

namespace app\listener;

use app\services\connect\ScanConnectService;
use app\services\connect\SpaceConnectService;
use app\services\connect\UserConnectService;
use app\services\connect\ManagerConnectService;
use think\Request;

class WsConnect
{
    /**
     * 事件监听处理
     *
     * @return void
     */
    public function handle(Request $event){
		$connect = $event->get('connect');
		switch ($connect) {
            case 'space':
                SpaceConnectService::doSpaceConnect($event);
                break;
            case 'user':
                UserConnectService::doUserConnect($event);
                break;
            case 'scan':
                ScanConnectService::doScanConnect($event);
                break;
            case 'manager':
                ManagerConnectService::doManagerConnect($event);
                break;

        }

    }
}
