feat(controller): 实现了控制器基类

This commit is contained in:
李东云
2022-04-25 10:04:08 +08:00
parent 67732e60e0
commit 0773d7aa41
3 changed files with 1302 additions and 31 deletions

View File

@@ -7,6 +7,7 @@
"composer/composer": "*",
"ergebnis/http-method": "^2.2",
"hyperf/di": "^2.2",
"hyperf/http-server": "^2.2",
"lmc/http-constants": "^1.2",
"roave/dont": "^1.5",
"teapot/status-code": "^1.1"

1268
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,64 @@
<?php
/**
* AbstractController.php@hyperf-development-kit
*
* @author 李东云<dongyun.li@luxcreo.cn>
* Powered by PhpStorm
* Created on 2022/4/25
*/
namespace Singularity\HyperfDevelopmentKit\Controller;
use Dont\DontCall;
use Dont\DontCallStatic;
use Dont\DontClone;
use Dont\DontDeserialise;
use Dont\DontGet;
use Dont\DontInstantiate;
use Dont\DontSerialise;
use Dont\DontSet;
use Dont\DontToString;
use Hyperf\Contract\ContainerInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
/**
* 抽象控制器基类
* Singularity\HyperfDevelopmentKit\Controller\AbstractController@hyperf-development-kit
*
* @author 李东云<dongyun.li@luxcreo.cn>
* Powered by PhpStorm
* Created on 2022/4/25
*/
abstract class AbstractController
{
use DontInstantiate;
use DontGet;
use DontSet;
use DontCall;
use DontCallStatic;
use DontClone;
use DontSerialise;
use DontDeserialise;
use DontToString;
/**
* @Inject
* @var ContainerInterface
*/
protected ContainerInterface $container;
/**
* @Inject
* @var RequestInterface
*/
protected RequestInterface $request;
/**
* @Inject
* @var ResponseInterface
*/
protected ResponseInterface $response;
}