dataLists(new SafetyRehearsalLists()); } /** * @notes 添加安全演练 * @return \think\response\Json * @author likeadmin * @date 2023/12/20 10:05 */ public function add() { $params = (new SafetyRehearsalValidate())->post()->goCheck('add'); $result = SafetyRehearsalLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(SafetyRehearsalLogic::getError()); } /** * @notes 编辑安全演练 * @return \think\response\Json * @author likeadmin * @date 2023/12/20 10:05 */ public function edit() { $params = (new SafetyRehearsalValidate())->post()->goCheck('edit'); $result = SafetyRehearsalLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(SafetyRehearsalLogic::getError()); } /** * @notes 删除安全演练 * @return \think\response\Json * @author likeadmin * @date 2023/12/20 10:05 */ public function delete() { $params = (new SafetyRehearsalValidate())->post()->goCheck('delete'); SafetyRehearsalLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取安全演练详情 * @return \think\response\Json * @author likeadmin * @date 2023/12/20 10:05 */ public function detail() { $params = (new SafetyRehearsalValidate())->goCheck('detail'); $result = SafetyRehearsalLogic::detail($params); return $this->data($result); } }