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 @@ + + +
+ +