mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKit.git
synced 2026-01-15 00:35:08 +08:00
feat(controller): 实现了控制器基类
This commit is contained in:
@@ -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
1268
composer.lock
generated
File diff suppressed because it is too large
Load Diff
64
src/Controller/AbstractController.php
Normal file
64
src/Controller/AbstractController.php
Normal 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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user