From 5da616e83ff48136e6e4edfd40df36b733a368a1 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Nov 2021 01:18:49 +0800 Subject: [PATCH] 111 --- src/Annotation/JsonRpc.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Annotation/JsonRpc.php b/src/Annotation/JsonRpc.php index 88ee6a6..c68d3e2 100644 --- a/src/Annotation/JsonRpc.php +++ b/src/Annotation/JsonRpc.php @@ -39,18 +39,16 @@ use ReflectionException; */ public function execute(mixed $class, mixed $method = ''): bool { -// $default = $this->create(); -// $agent = Kiri::getDi()->get(Agent::class); -// $data = $agent->service->register($default); -// if ($data->getStatusCode() != 200) { -// exit($data->getBody()->getContents()); -// } -// return RpcManager::add($this->service, $class, $default['id']); - return true; + $default = $this->create(); + $agent = Kiri::getDi()->get(Agent::class); + $data = $agent->service->register($default); + if ($data->getStatusCode() != 200) { + exit($data->getBody()->getContents()); + } + return RpcManager::add($this->service, $class, $default['id']); } - /** * @throws ConfigException */