This commit is contained in:
2021-03-05 17:11:47 +08:00
parent 04ad150bba
commit bfebcce204
4 changed files with 49 additions and 37 deletions
+2 -1
View File
@@ -43,7 +43,8 @@ use Snowflake\Snowflake;
// TODO: Implement setHandler() method.
$router = Snowflake::app()->getRouter();
$router->addRoute($this->uri, $handler, $this->method);
$node = $router->addRoute($this->uri, $handler, $this->method);
$node::annotationInject($node, get_class($handler[0]), $handler[1]);
return $router;
}
+3 -1
View File
@@ -53,7 +53,9 @@ use Snowflake\Snowflake;
$method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
$router->addRoute($method, $handler, 'sw::socket');
$node = $router->addRoute($method, $handler, 'sw::socket');
$node::annotationInject($node, get_class($handler[0]), $handler[1]);
return $router;
}