123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace catchAdmin\alarm\controller;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- use catchAdmin\alarm\model\BwList as bwListModel;
- class BwList extends CatchController
- {
- protected $bwListModel;
-
- public function __construct(BwListModel $bwListModel)
- {
- $this->bwListModel = $bwListModel;
- }
-
- /**
- * 列表
- * @time 2022年10月26日 10:32
- * @param Request $request
- */
- public function index(Request $request) : \think\Response
- {
- return CatchResponse::paginate($this->bwListModel->getList());
- }
-
- /**
- * 保存信息
- * @time 2022年10月26日 10:32
- * @param Request $request
- */
- public function save(Request $request) : \think\Response
- {
- return CatchResponse::success($this->bwListModel->storeBy($request->post()));
- }
-
- /**
- * 读取
- * @time 2022年10月26日 10:32
- * @param $id
- */
- public function read($id) : \think\Response
- {
- return CatchResponse::success($this->bwListModel->findBy($id));
- }
-
- /**
- * 更新
- * @time 2022年10月26日 10:32
- * @param Request $request
- * @param $id
- */
- public function update(Request $request, $id) : \think\Response
- {
- return CatchResponse::success($this->bwListModel->updateBy($id, $request->post()));
- }
-
- /**
- * 删除
- * @time 2022年10月26日 10:32
- * @param $id
- */
- public function delete($id) : \think\Response
- {
- return CatchResponse::success($this->bwListModel->deleteBy($id,true));
- }
- }
|