From 46e6e2b2c24c9e00d205723fd0b5d28addd0f22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 29 Nov 2021 15:57:36 +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 a152e9a..c68d3e2 100644 --- a/src/Annotation/JsonRpc.php +++ b/src/Annotation/JsonRpc.php @@ -15,11 +15,11 @@ use ReflectionException; /** - * @param string $service_name + * @param string $service * @param string $driver * @param array $checkOptions */ - public function __construct(public string $service_name, 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->service_name, $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->service_name}." . md5(__DIR__ . '.' . md5($content)), - "name" => $this->service_name, + "id" => "rpc.json.{$this->service}." . md5(__DIR__ . '.' . md5($content)), + "name" => $this->service, "address" => $content, "port" => 9526, "enableTagOverride" => true,