From 18fea029f83b14145b3dc0375250a45ed31e80d6 Mon Sep 17 00:00:00 2001 From: Dai Date: Wed, 24 Jul 2024 22:13:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=9B=BE=E3=80=81=E8=BD=AE?= =?UTF-8?q?=E6=92=AD=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/BackgroundController.php | 25 ++ app/api/controller/SlideshowController.php | 20 ++ app/common/model/Background.php | 19 ++ app/common/model/Slideshow.php | 22 ++ app/common/service/SlideshowService.php | 29 ++ .../app/controller/BackgroundController.php | 68 +++++ .../app/controller/SlideshowController.php | 68 +++++ plugin/admin/app/model/Background.php | 32 +++ plugin/admin/app/model/Slideshow.php | 33 +++ plugin/admin/app/view/background/index.html | 262 +++++++++++++++++ plugin/admin/app/view/background/insert.html | 121 ++++++++ plugin/admin/app/view/background/update.html | 159 +++++++++++ plugin/admin/app/view/slideshow/index.html | 265 ++++++++++++++++++ plugin/admin/app/view/slideshow/insert.html | 128 +++++++++ plugin/admin/app/view/slideshow/update.html | 166 +++++++++++ 15 files changed, 1417 insertions(+) create mode 100644 app/api/controller/BackgroundController.php create mode 100644 app/api/controller/SlideshowController.php create mode 100644 app/common/model/Background.php create mode 100644 app/common/model/Slideshow.php create mode 100644 app/common/service/SlideshowService.php create mode 100644 plugin/admin/app/controller/BackgroundController.php create mode 100644 plugin/admin/app/controller/SlideshowController.php create mode 100644 plugin/admin/app/model/Background.php create mode 100644 plugin/admin/app/model/Slideshow.php create mode 100644 plugin/admin/app/view/background/index.html create mode 100644 plugin/admin/app/view/background/insert.html create mode 100644 plugin/admin/app/view/background/update.html create mode 100644 plugin/admin/app/view/slideshow/index.html create mode 100644 plugin/admin/app/view/slideshow/insert.html create mode 100644 plugin/admin/app/view/slideshow/update.html diff --git a/app/api/controller/BackgroundController.php b/app/api/controller/BackgroundController.php new file mode 100644 index 0000000..d10ad64 --- /dev/null +++ b/app/api/controller/BackgroundController.php @@ -0,0 +1,25 @@ + 1])->field('url')->find(); + + return $this->json([ + 'code' => ResponseCode::SUCCESS, + 'data' => $background, + 'msg' => 'success' + ]); + } + +} \ No newline at end of file diff --git a/app/api/controller/SlideshowController.php b/app/api/controller/SlideshowController.php new file mode 100644 index 0000000..d979df2 --- /dev/null +++ b/app/api/controller/SlideshowController.php @@ -0,0 +1,20 @@ +getSlideshow(); + return $this->json($result); + } + +} \ No newline at end of file diff --git a/app/common/model/Background.php b/app/common/model/Background.php new file mode 100644 index 0000000..b92e6ef --- /dev/null +++ b/app/common/model/Background.php @@ -0,0 +1,19 @@ +field('img')->select(); + + return [ + 'code' => ResponseCode::SUCCESS, + 'data' => $list, + 'msg' => 'success' + ]; + } + +} \ No newline at end of file diff --git a/plugin/admin/app/controller/BackgroundController.php b/plugin/admin/app/controller/BackgroundController.php new file mode 100644 index 0000000..47a18c8 --- /dev/null +++ b/plugin/admin/app/controller/BackgroundController.php @@ -0,0 +1,68 @@ +model = new Background; + } + + /** + * 浏览 + * @return Response + */ + public function index(): Response + { + return view('background/index'); + } + + /** + * 插入 + * @param Request $request + * @return Response + * @throws BusinessException + */ + public function insert(Request $request): Response + { + if ($request->method() === 'POST') { + return parent::insert($request); + } + return view('background/insert'); + } + + /** + * 更新 + * @param Request $request + * @return Response + * @throws BusinessException + */ + public function update(Request $request): Response + { + if ($request->method() === 'POST') { + return parent::update($request); + } + return view('background/update'); + } + +} diff --git a/plugin/admin/app/controller/SlideshowController.php b/plugin/admin/app/controller/SlideshowController.php new file mode 100644 index 0000000..c453c21 --- /dev/null +++ b/plugin/admin/app/controller/SlideshowController.php @@ -0,0 +1,68 @@ +model = new Slideshow; + } + + /** + * 浏览 + * @return Response + */ + public function index(): Response + { + return view('slideshow/index'); + } + + /** + * 插入 + * @param Request $request + * @return Response + * @throws BusinessException + */ + public function insert(Request $request): Response + { + if ($request->method() === 'POST') { + return parent::insert($request); + } + return view('slideshow/insert'); + } + + /** + * 更新 + * @param Request $request + * @return Response + * @throws BusinessException + */ + public function update(Request $request): Response + { + if ($request->method() === 'POST') { + return parent::update($request); + } + return view('slideshow/update'); + } + +} diff --git a/plugin/admin/app/model/Background.php b/plugin/admin/app/model/Background.php new file mode 100644 index 0000000..0ee230b --- /dev/null +++ b/plugin/admin/app/model/Background.php @@ -0,0 +1,32 @@ + + + + + 浏览页面 + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + diff --git a/plugin/admin/app/view/background/insert.html b/plugin/admin/app/view/background/insert.html new file mode 100644 index 0000000..84abafa --- /dev/null +++ b/plugin/admin/app/view/background/insert.html @@ -0,0 +1,121 @@ + + + + + 新增页面 + + + + + + +
+ +
+
+ +
+ +
+ + + + +
+
+ +
+
+ +
+
+ + +
+
+ +
+ + + + + + + + + + diff --git a/plugin/admin/app/view/background/update.html b/plugin/admin/app/view/background/update.html new file mode 100644 index 0000000..274e7f6 --- /dev/null +++ b/plugin/admin/app/view/background/update.html @@ -0,0 +1,159 @@ + + + + + 更新页面 + + + + + + + +
+ +
+
+ +
+ +
+ + + + +
+
+ +
+
+ +
+
+ + +
+
+ +
+ + + + + + + + + + + diff --git a/plugin/admin/app/view/slideshow/index.html b/plugin/admin/app/view/slideshow/index.html new file mode 100644 index 0000000..d97b4c8 --- /dev/null +++ b/plugin/admin/app/view/slideshow/index.html @@ -0,0 +1,265 @@ + + + + + + 浏览页面 + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + diff --git a/plugin/admin/app/view/slideshow/insert.html b/plugin/admin/app/view/slideshow/insert.html new file mode 100644 index 0000000..483dce6 --- /dev/null +++ b/plugin/admin/app/view/slideshow/insert.html @@ -0,0 +1,128 @@ + + + + + 新增页面 + + + + + + +
+ +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+ + + + + + + + + + diff --git a/plugin/admin/app/view/slideshow/update.html b/plugin/admin/app/view/slideshow/update.html new file mode 100644 index 0000000..5200cbe --- /dev/null +++ b/plugin/admin/app/view/slideshow/update.html @@ -0,0 +1,166 @@ + + + + + 更新页面 + + + + + + + +
+ +
+
+ +
+ +
+ + + + +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+ + + + + + + + + + +