diff --git a/Annotation/Route/Cmd.php b/Annotation/Route/Cmd.php deleted file mode 100644 index f6062d6f..00000000 --- a/Annotation/Route/Cmd.php +++ /dev/null @@ -1,51 +0,0 @@ -getRouter(); - - $router->addRoute($this->cmd, $handler, Request::HTTP_CMD); - - return $router; - } - - -} diff --git a/Annotation/Route/RpcService.php b/Annotation/Route/RpcService.php new file mode 100644 index 00000000..e546e5ca --- /dev/null +++ b/Annotation/Route/RpcService.php @@ -0,0 +1,52 @@ +uri = 'rpc/' . $this->port . '/' . ltrim($this->cmd, '/'); + } + + + /** + * @param array $handler + * @return Router + * @throws ConfigException + * @throws Exception + */ + public function execute(array $handler): Router + { + // TODO: Implement setHandler() method. + $router = Snowflake::app()->getRouter(); + + $router->addRoute($this->uri, $handler, Request::HTTP_CMD); + + return $router; + } + + +}