From 2c6de7c547cddd3eedc72baec90a7f6c4e207b0b Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Thu, 6 Jun 2024 15:55:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/controller/FileController.php | 126 ++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 app/store/controller/FileController.php diff --git a/app/store/controller/FileController.php b/app/store/controller/FileController.php new file mode 100644 index 000000000..ef520949d --- /dev/null +++ b/app/store/controller/FileController.php @@ -0,0 +1,126 @@ +dataLists(new FileLists()); + } + + #[ + ApiDoc\Title('移动'), + ApiDoc\url('/store/file/move'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function move() + { + $params = (new FileValidate())->post()->goCheck('move'); + FileLogic::move($params); + return $this->success('移动成功', [], 1, 1); + } + + #[ + ApiDoc\Title('重命名'), + ApiDoc\url('/store/file/rename'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function rename() + { + $params = (new FileValidate())->post()->goCheck('rename'); + FileLogic::rename($params); + return $this->success('重命名成功', [], 1, 1); + } + + #[ + ApiDoc\Title('删除'), + ApiDoc\url('/store/file/delete'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function delete() + { + $params = (new FileValidate())->post()->goCheck('delete'); + FileLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + #[ + ApiDoc\Title('分类列表'), + ApiDoc\url('/store/file/listCate'), + ApiDoc\Method('GET'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function listCate() + { + return $this->dataLists(new FileCateLists()); + } + + #[ + ApiDoc\Title('添加文件分类'), + ApiDoc\url('/store/file/addCate'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function addCate() + { + $params = (new FileValidate())->post()->goCheck('addCate'); + FileLogic::addCate($params); + return $this->success('添加成功', [], 1, 1); + } + + #[ + ApiDoc\Title('编辑文件分类'), + ApiDoc\url('/store/file/editCate'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function editCate() + { + $params = (new FileValidate())->post()->goCheck('editCate'); + FileLogic::editCate($params); + return $this->success('编辑成功', [], 1, 1); + } + + #[ + ApiDoc\Title('删除文件分类'), + ApiDoc\url('/store/file/delCate'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function delCate() + { + $params = (new FileValidate())->post()->goCheck('id'); + FileLogic::delCate($params); + return $this->success('删除成功', [], 1, 1); + } +}