mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
add Middleware
This commit is contained in:
19
src/ZM/Annotation/Http/After.php
Normal file
19
src/ZM/Annotation/Http/After.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\Annotation\Http;
|
||||
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Required;
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
|
||||
/**
|
||||
* Class After
|
||||
* @package ZM\Annotation\Http
|
||||
* @Annotation
|
||||
* @Target("METHOD")
|
||||
*/
|
||||
class After extends AnnotationBase
|
||||
{
|
||||
}
|
||||
19
src/ZM/Annotation/Http/Before.php
Normal file
19
src/ZM/Annotation/Http/Before.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\Annotation\Http;
|
||||
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Required;
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
|
||||
/**
|
||||
* Class Before
|
||||
* @package ZM\Annotation\Http
|
||||
* @Annotation
|
||||
* @Target("METHOD")
|
||||
*/
|
||||
class Before extends AnnotationBase
|
||||
{
|
||||
}
|
||||
23
src/ZM/Annotation/Http/HandleException.php
Normal file
23
src/ZM/Annotation/Http/HandleException.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\Annotation\Http;
|
||||
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use Exception;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
|
||||
/**
|
||||
* Class HandleException
|
||||
* @package ZM\Annotation\Http
|
||||
* @Annotation
|
||||
* @Target("METHOD")
|
||||
*/
|
||||
class HandleException extends AnnotationBase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $class_name = Exception::class;
|
||||
}
|
||||
24
src/ZM/Annotation/Http/Middleware.php
Normal file
24
src/ZM/Annotation/Http/Middleware.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\Annotation\Http;
|
||||
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Required;
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
|
||||
/**
|
||||
* Class Middleware
|
||||
* @package ZM\Annotation\Http
|
||||
* @Annotation
|
||||
* @Target("METHOD")
|
||||
*/
|
||||
class Middleware extends AnnotationBase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @Required()
|
||||
*/
|
||||
public $middleware;
|
||||
}
|
||||
19
src/ZM/Annotation/Http/MiddlewareClass.php
Normal file
19
src/ZM/Annotation/Http/MiddlewareClass.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\Annotation\Http;
|
||||
|
||||
|
||||
use Doctrine\Common\Annotations\Annotation\Target;
|
||||
use ZM\Annotation\AnnotationBase;
|
||||
|
||||
/**
|
||||
* Class MiddlewareClass
|
||||
* @package ZM\Annotation\Http
|
||||
* @Annotation
|
||||
* @Target("CLASS")
|
||||
*/
|
||||
class MiddlewareClass extends AnnotationBase
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user