From 7d1cbbb8d18225e134e2cb3bfb2b5ee69f3c5617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 1 Nov 2021 18:18:39 +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 --- src/Annotation/JsonRpc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Annotation/JsonRpc.php b/src/Annotation/JsonRpc.php index fe44cb8..c68d3e2 100644 --- a/src/Annotation/JsonRpc.php +++ b/src/Annotation/JsonRpc.php @@ -15,11 +15,11 @@ use ReflectionException; /** - * @param string $method + * @param string $service * @param string $driver * @param array $checkOptions */ - public function __construct(public string $method, public string $driver, public array $checkOptions = [ + public function __construct(public string $service, public string $driver, public array $checkOptions = [ "DeregisterCriticalServiceAfter" => "1m", "Http" => "http://127.0.0.1:9527", "Interval" => "1s", @@ -45,7 +45,7 @@ use ReflectionException; if ($data->getStatusCode() != 200) { exit($data->getBody()->getContents()); } - return RpcManager::add($this->method, $class, $default['id']); + return RpcManager::add($this->service, $class, $default['id']); } @@ -56,8 +56,8 @@ use ReflectionException; { $content = current(swoole_get_local_ip()); return [ - "id" => "rpc.json.{$this->method}." . md5(__DIR__ . '.' . md5($content)), - "name" => $this->method, + "id" => "rpc.json.{$this->service}." . md5(__DIR__ . '.' . md5($content)), + "name" => $this->service, "address" => $content, "port" => 9526, "enableTagOverride" => true,