dataLists(new DictConfigLists()); } /** * @notes 添加字典数据 * @return \think\response\Json */ public function add() { $params = (new DictConfigValidate())->post()->goCheck('add'); $result = DictConfigLogic::save($params); if (false === $result) { return $this->fail(DictConfigLogic::getError()); } return $this->success('添加成功', [], 1, 1); } /** * @notes 编辑字典数据 * @return \think\response\Json */ public function edit() { $params = (new DictConfigValidate())->post()->goCheck('edit'); $result = DictConfigLogic::save($params); if (false === $result) { return $this->fail(DictConfigLogic::getError()); } return $this->success('编辑成功', [], 1, 1); } /** * @notes 删除字典数据 * @return \think\response\Json */ public function delete() { $params = (new DictConfigValidate())->post()->goCheck('id'); DictConfigLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取字典详情 * @return \think\response\Json */ public function detail() { $params = (new DictConfigValidate())->goCheck('id'); $result = DictConfigLogic::detail($params); return $this->data($result); } }