From 49b1649d183239e9a09b27161030fcbd2ffe233c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 28 Oct 2021 11:09:14 +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 --- kiri-gii/Gii.php | 4 ++ kiri-gii/GiiCommand.php | 3 +- kiri-gii/GiiJsonRpc.php | 108 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 kiri-gii/GiiJsonRpc.php diff --git a/kiri-gii/Gii.php b/kiri-gii/Gii.php index 766d5ca6..e0aabaea 100644 --- a/kiri-gii/Gii.php +++ b/kiri-gii/Gii.php @@ -89,6 +89,10 @@ class Gii $task = new GiiRpcService(); $task->setInput($this->input); return $task->generate(); + case 'json-rpc': + $task = new GiiJsonRpc(); + $task->setInput($this->input); + return $task->create(); default: return $this->getModel($make, $input); } diff --git a/kiri-gii/GiiCommand.php b/kiri-gii/GiiCommand.php index f989ef8e..c8b0c021 100644 --- a/kiri-gii/GiiCommand.php +++ b/kiri-gii/GiiCommand.php @@ -40,9 +40,8 @@ class GiiCommand extends Command /** * @param InputInterface $input * @param OutputInterface $output - * @return array + * @return int * @throws ConfigException - * @throws Exception */ public function execute(InputInterface $input, OutputInterface $output): int { diff --git a/kiri-gii/GiiJsonRpc.php b/kiri-gii/GiiJsonRpc.php new file mode 100644 index 00000000..dbbe6ce9 --- /dev/null +++ b/kiri-gii/GiiJsonRpc.php @@ -0,0 +1,108 @@ +createInterface($this->input->getArgument('name')), + $this->createProducers($this->input->getArgument('name')), + $this->createConsumer($this->input->getArgument('name')), + ]; + } + + + private function createInterface($name) + { + $html = '