2020-03-02 16:14:20 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace ZM\Annotation\Http;
|
|
|
|
|
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Required;
|
|
|
|
|
use Doctrine\Common\Annotations\Annotation\Target;
|
|
|
|
|
use ZM\Annotation\AnnotationBase;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class RequestMapping
|
|
|
|
|
* @Annotation
|
2020-08-31 10:11:06 +08:00
|
|
|
* @Target("METHOD")
|
2020-03-02 16:14:20 +08:00
|
|
|
* @package ZM\Annotation\Http
|
|
|
|
|
*/
|
|
|
|
|
class RequestMapping extends AnnotationBase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
* @Required()
|
|
|
|
|
*/
|
|
|
|
|
public $route = '';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
public $name = '';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
public $request_method = [RequestMethod::GET, RequestMethod::POST];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Routing path params binding. eg. {"id"="\d+"}
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
public $params = [];
|
2020-08-31 10:11:06 +08:00
|
|
|
}
|