feat:兼容开发

main
gzydong 2022-01-22 21:08:28 +08:00
parent 79c90a385f
commit 92ee37b381
2 changed files with 5 additions and 32 deletions

View File

@ -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
]);
}
}

View File

@ -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;
/** /**
* 连接创建成功回调事件 * 连接创建成功回调事件