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 */