From ba7156770e8fecf10dae66a20cc43b908da16ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 5 Aug 2021 17:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Attribute.php | 15 +++++---------- Server/Worker/OnServerWorker.php | 3 +++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Annotation/Attribute.php b/Annotation/Attribute.php index 067281bc..3948f36c 100644 --- a/Annotation/Attribute.php +++ b/Annotation/Attribute.php @@ -4,15 +4,6 @@ namespace Annotation; -use Annotation\Route\After; -use Annotation\Route\Interceptor; -use Annotation\Route\Limits; -use Annotation\Route\Middleware as RMiddleware; -use HttpServer\Route\Node; -use ReflectionException; -use Snowflake\Exception\ComponentException; -use Snowflake\Exception\NotFindClassException; -use Snowflake\Snowflake; /** * Class Attribute @@ -22,7 +13,11 @@ abstract class Attribute implements IAnnotation { - + /** + * @param mixed $class + * @param mixed|string $method + * @return mixed + */ public function execute(mixed $class, mixed $method = ''): mixed { // TODO: Implement execute() method. diff --git a/Server/Worker/OnServerWorker.php b/Server/Worker/OnServerWorker.php index 7ef9a14c..3e28e9ac 100644 --- a/Server/Worker/OnServerWorker.php +++ b/Server/Worker/OnServerWorker.php @@ -71,6 +71,9 @@ class OnServerWorker extends \Server\Abstracts\Server $di = Snowflake::getDi(); foreach ($fileLists as $class) { $instance = $di->get($class); + foreach ($di->getTargetNote($class) as $value) { + $value->execute($instance); + } $methods = $di->getMethodAttribute($class); foreach ($methods as $method => $attribute) { if (empty($attribute)) {