95 lines
2.1 KiB
PHP
95 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller\setting\cate;
|
|
|
|
|
|
use app\admin\controller\BaseAdminController;
|
|
use app\admin\lists\setting\cate\CateLists;
|
|
use app\admin\logic\setting\cate\CateLogic;
|
|
use app\admin\validate\setting\cate\CateValidate;
|
|
|
|
|
|
/**
|
|
* 首页导航控制器
|
|
* Class CateController
|
|
* @package app\admin\controller\setting/cate
|
|
*/
|
|
class CateController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取首页导航列表
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/12/27 20:14
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new CateLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加首页导航
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/12/27 20:14
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new CateValidate())->post()->goCheck('add');
|
|
$result = CateLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CateLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑首页导航
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/12/27 20:14
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new CateValidate())->post()->goCheck('edit');
|
|
$result = CateLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(CateLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除首页导航
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/12/27 20:14
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new CateValidate())->post()->goCheck('delete');
|
|
CateLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取首页导航详情
|
|
* @return \think\response\Json
|
|
* @author admin
|
|
* @date 2024/12/27 20:14
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new CateValidate())->goCheck('detail');
|
|
$result = CateLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
|
|
} |