改名
This commit is contained in:
+12
-1
@@ -4,6 +4,14 @@
|
|||||||
namespace Annotation;
|
namespace Annotation;
|
||||||
|
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Snowflake\Snowflake;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Port
|
||||||
|
* @package Annotation
|
||||||
|
*/
|
||||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Port extends Attribute
|
#[\Attribute(\Attribute::TARGET_METHOD)] class Port extends Attribute
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -20,10 +28,13 @@ namespace Annotation;
|
|||||||
/**
|
/**
|
||||||
* @param array $handler
|
* @param array $handler
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function execute(array $handler): mixed
|
public function execute(array $handler): mixed
|
||||||
{
|
{
|
||||||
return parent::execute($handler); // TODO: Change the autogenerated stub
|
$router = Snowflake::app()->getRouter();
|
||||||
|
$router->addPortListen($this->port, $handler);
|
||||||
|
return parent::execute($handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user