12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- /*
- * @Descripttion:
- * @version: 1.0.0
- * @Author: likang
- * @Date: 2022-07-26 16:16:11
- * @LastEditors: likang
- * @LastEditTime: 2022-07-28 17:47:29
- */
- namespace catchAdmin\system\controller;
- use catchAdmin\api\Directive;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- use catchAdmin\system\model\Lssue as lssueModel;
- class Lssue extends CatchController
- {
- protected $lssueModel;
- public function __construct(LssueModel $lssueModel)
- {
- $this->lssueModel = $lssueModel;
- }
- /**
- * 列表
- * @time 2022年07月26日 16:16
- * @param Request $request
- */
- public function index(Request $request): \think\Response
- {
- return CatchResponse::paginate($this->lssueModel->getList());
- }
- /**
- * 保存信息
- * @time 2022年07月26日 16:16
- * @param Request $request
- */
- public function save(Request $request): \think\Response
- {
- $data = $request->post();
- $this->lssueModel->storeBy($request->post());
- $content = [
- 'type' => $data['type'],
- 'file_name' => $data['file_name'],
- 'equ_ids' => $data['equ_ids']
- ];
- // Directive::Issued($data['type'],);
- $this->lssueModel->IssueAll($content);
- return CatchResponse::success();
- }
- /**
- * 读取
- * @time 2022年07月26日 16:16
- * @param $id
- */
- public function read($id): \think\Response
- {
- return CatchResponse::success($this->lssueModel->findBy($id));
- }
- /**
- * 更新
- * @time 2022年07月26日 16:16
- * @param Request $request
- * @param $id
- */
- public function update(Request $request, $id): \think\Response
- {
- return CatchResponse::success($this->lssueModel->updateBy($id, $request->post()));
- }
- /**
- * 删除
- * @time 2022年07月26日 16:16
- * @param $id
- */
- public function delete($id): \think\Response
- {
- return CatchResponse::success($this->lssueModel->deleteBy($id, true));
- }
- }
|