feat:兼容开发
parent
79c90a385f
commit
92ee37b381
|
@ -1,26 +0,0 @@
|
||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Controller;
|
|
||||||
|
|
||||||
use Hyperf\HttpServer\Annotation\Controller;
|
|
||||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试相关控制器
|
|
||||||
* @Controller()
|
|
||||||
*
|
|
||||||
* @package App\Controller
|
|
||||||
*/
|
|
||||||
class TestController extends AbstractController
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @RequestMapping(path="index", methods="get")
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
return $this->response->json([
|
|
||||||
'code' => 200
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,10 +12,10 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Hyperf\Di\Annotation\Inject;
|
||||||
use App\Cache\SocketRoom;
|
use App\Cache\SocketRoom;
|
||||||
use App\Service\Group\GroupMemberService;
|
use App\Service\Group\GroupMemberService;
|
||||||
use App\Service\Message\ReceiveHandleService;
|
use App\Service\Message\ReceiveHandleService;
|
||||||
use Hyperf\Di\Annotation\Inject;
|
|
||||||
use App\Constant\TalkEventConstant;
|
use App\Constant\TalkEventConstant;
|
||||||
use Hyperf\Contract\OnCloseInterface;
|
use Hyperf\Contract\OnCloseInterface;
|
||||||
use Hyperf\Contract\OnMessageInterface;
|
use Hyperf\Contract\OnMessageInterface;
|
||||||
|
@ -27,7 +27,6 @@ use Swoole\WebSocket\Server;
|
||||||
use App\Service\SocketClientService;
|
use App\Service\SocketClientService;
|
||||||
use App\Event\TalkEvent;
|
use App\Event\TalkEvent;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class WebSocketController
|
* Class WebSocketController
|
||||||
*
|
*
|
||||||
|
@ -36,16 +35,16 @@ use App\Event\TalkEvent;
|
||||||
class WebSocketController implements OnMessageInterface, OnOpenInterface, OnCloseInterface
|
class WebSocketController implements OnMessageInterface, OnOpenInterface, OnCloseInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @inject
|
* @Inject
|
||||||
* @var SocketClientService
|
* @var SocketClientService
|
||||||
*/
|
*/
|
||||||
private $client;
|
protected $client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inject
|
* @Inject
|
||||||
* @var ReceiveHandleService
|
* @var ReceiveHandleService
|
||||||
*/
|
*/
|
||||||
private $receiveHandle;
|
protected $receiveHandle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 连接创建成功回调事件
|
* 连接创建成功回调事件
|
||||||
|
|
Loading…
Reference in New Issue