95 lines
2.1 KiB
PHP
95 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\config;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\config\ConfigLists;
|
|
use app\admin\logic\ConfigLogic;
|
|
use app\admin\validate\config\ConfigValidate;
|
|
|
|
|
|
/**
|
|
* 配置表控制器
|
|
* Class ConfigController
|
|
* @package app\admin\controller\config
|
|
*/
|
|
class ConfigController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取配置表列表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/06/24 17:52
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new ConfigLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加配置表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/06/24 17:52
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new ConfigValidate())->post()->goCheck('add');
|
|
$result = ConfigLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ConfigLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑配置表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/06/24 17:52
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new ConfigValidate())->post()->goCheck('edit');
|
|
$result = ConfigLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ConfigLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除配置表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/06/24 17:52
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new ConfigValidate())->post()->goCheck('delete');
|
|
ConfigLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取配置表详情
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/06/24 17:52
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new ConfigValidate())->goCheck('detail');
|
|
$result = ConfigLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
|
|
} |