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 = '