12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- /*
- * @Descripttion:
- * @version: 1版本
- * @Author: 李康
- * @Date: 2022-06-07 10:16:15
- * @LastEditors: 李康
- * @LastEditTime: 2022-06-08 17:29:17
- */
- namespace catchAdmin\email\controller;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- use catchAdmin\email\model\Email as emailModel;
- class Email extends CatchController
- {
- protected $emailModel;
-
- public function __construct(EmailModel $emailModel)
- {
- $this->emailModel = $emailModel;
- }
-
- /**
- * 列表
- * @time 2022年06月07日 10:16
- * @param Request $request
- */
- public function index(Request $request) : \think\Response
- {
- return CatchResponse::paginate($this->emailModel->getList());
- }
-
- /**
- * 保存信息
- * @time 2022年06月07日 10:16
- * @param Request $request
- */
- public function save(Request $request) : \think\Response
- {
-
- return CatchResponse::success($this->emailModel->storeBy($request->post()));
- }
-
- /**
- * 读取
- * @time 2022年06月07日 10:16
- * @param $id
- */
- public function read($id) : \think\Response
- {
- return CatchResponse::success($this->emailModel->findBy($id));
- }
-
- /**
- * 更新
- * @time 2022年06月07日 10:16
- * @param Request $request
- * @param $id
- */
- public function update(Request $request, $id) : \think\Response
- {
- return CatchResponse::success($this->emailModel->updateBy($id, $request->post()));
- }
-
- /**
- * 删除
- * @time 2022年06月07日 10:16
- * @param $id
- */
- public function delete($id) : \think\Response
- {
- return CatchResponse::success($this->emailModel->deleteBy($id));
- }
-
- /**
- *
- */
- public function setEmail()
- {
- $array = ['17837032683@139.com'];
- $this->emailModel->setEmail($array,'警告报警','我还不知道',null);
- }
- }
|