modify plugin name

This commit is contained in:
2022-03-01 14:19:48 +08:00
parent 0b9d570871
commit 875cbe08db
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -9,11 +9,11 @@ use Kiri\Annotation\AbstractAttribute;
/** /**
* @param Method $method * @param RequestMethod $method
* @param string $path * @param string $path
* @param string|null $version * @param string|null $version
*/ */
public function __construct(Method $method, string $path, string $version = null) public function __construct(RequestMethod $method, string $path, string $version = null)
{ {
} }
@@ -2,7 +2,7 @@
namespace Kiri\Annotation\Route; namespace Kiri\Annotation\Route;
enum Method enum RequestMethod
{ {
+3 -3
View File
@@ -14,10 +14,10 @@ use Kiri;
/** /**
* Route constructor. * Route constructor.
* @param string $uri * @param string $uri
* @param Method $method * @param RequestMethod $method
* @param string $version * @param string $version
*/ */
public function __construct(public string $uri, public Method $method, public string $version = 'v.1.0') public function __construct(public string $uri, public RequestMethod $method, public string $version = 'v.1.0')
{ {
$this->uri = '/' . ltrim($this->uri, '/'); $this->uri = '/' . ltrim($this->uri, '/');
} }
@@ -31,7 +31,7 @@ use Kiri;
public function execute(mixed $class, mixed $method = null): bool public function execute(mixed $class, mixed $method = null): bool
{ {
$di = Kiri::getDi()->get(Router::class); $di = Kiri::getDi()->get(Router::class);
$di->addRoute($this->method->getString(), $this->uri, $class . '@' . $method); $di->addRoute($this->method, $this->uri, $class . '@' . $method);
return parent::execute($class, $method); return parent::execute($class, $method);
} }
+1 -1
View File
@@ -12,7 +12,7 @@ class TestController
/** /**
* @return void * @return void
*/ */
#[RequestMapping(method: Method::REQUEST_GET, path: '/', version: 'v1')] #[RequestMapping(method: RequestMethod::REQUEST_GET, path: '/', version: 'v1')]
#[Aspect(aspect: LoggerAspect::class)] #[Aspect(aspect: LoggerAspect::class)]
#[Middleware(middleware: LoggerAspect::class)] #[Middleware(middleware: LoggerAspect::class)]
public function index() public function index()