From a36f867dbe338d5542af870e292367f7ca5de086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 6 Apr 2021 18:42:21 +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 --- Gii/GiiController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Gii/GiiController.php b/Gii/GiiController.php index 6a03b3a5..a82cb488 100644 --- a/Gii/GiiController.php +++ b/Gii/GiiController.php @@ -69,6 +69,8 @@ namespace {$namespace}; $import = "use Snowflake; use Exception; use Annotation\Target; +use Annotation\Route\Middleware; +use Annotation\Route\Route; use Snowflake\Core\Str; use Snowflake\Core\JSON; use HttpServer\Http\Request; @@ -174,6 +176,8 @@ use {$model_namespace}\\{$managerName}; * @return string * @throws Exception */ + #[Route(uri: "' . lcfirst($className) . '/add", method: "POST")] + #[Middleware(middleware: [])] public function actionAdd(): string { $model = new ' . $className . '(); @@ -221,6 +225,8 @@ use {$model_namespace}\\{$managerName}; * @return string * @throws Exception */ + #[Route(uri: "' . lcfirst($className) . '/update", method: "POST")] + #[Middleware(middleware: [])] public function actionUpdate(): string { $model = ' . $className . '::findOne($this->input->post(\'id\', 0)); @@ -250,6 +256,8 @@ use {$model_namespace}\\{$managerName}; * @return string * @throws Exception */ + #[Route(uri: "' . lcfirst($className) . '/batch-delete", method: "POST")] + #[Middleware(middleware: [])] public function actionBatchDelete(): string { $_key = $this->input->array(\'ids\'); @@ -279,6 +287,8 @@ use {$model_namespace}\\{$managerName}; * @return string * @throws Exception */ + #[Route(uri: "' . lcfirst($className) . '/detail", method: "POST")] + #[Middleware(middleware: [])] public function actionDetail(): string { $model = ' . $managerName . '::findOne($this->input->get(\'id\')); @@ -303,6 +313,8 @@ use {$model_namespace}\\{$managerName}; * @return string * @throws Exception */ + #[Route(uri: "' . lcfirst($className) . '/delete", method: "POST")] + #[Middleware(middleware: [])] public function actionDelete(): string { $_key = $this->input->int(\'id\', true); @@ -333,6 +345,8 @@ use {$model_namespace}\\{$managerName}; * @return string * @throws Exception */ + #[Route(uri: "' . lcfirst($className) . '/list", method: "POST")] + #[Middleware(middleware: [])] public function actionList(): string { //分页处理