67 lines
1.5 KiB
PHP
Executable File
67 lines
1.5 KiB
PHP
Executable File
<?php
|
|
namespace app\adminapi\controller\setting;
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\logic\setting\TextLogic;
|
|
use app\adminapi\validate\setting\TextValidate;
|
|
|
|
class TextController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 列表
|
|
* @return \think\response\Json
|
|
* @author cjhao
|
|
* @date 2024/11/1 10:17
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists();
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加
|
|
* @return \think\response\Json
|
|
* @author cjhao
|
|
* @date 2024/11/1 10:17
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new TextValidate())->post()->goCheck('add');
|
|
(new TextLogic())->add($params);
|
|
return $this->success('添加成功',[],1,1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑
|
|
* @return \think\response\Json
|
|
* @author cjhao
|
|
* @date 2024/11/1 10:19
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new TextValidate())->post()->goCheck();
|
|
(new TextLogic())->edit($params);
|
|
return $this->success('编辑成功',[],1,1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除
|
|
* @return \think\response\Json
|
|
* @author cjhao
|
|
* @date 2024/11/1 10:21
|
|
*/
|
|
public function del()
|
|
{
|
|
$params = (new TextValidate())->post()->goCheck('id');
|
|
$result = (new TextLogic())->del($params['id']);
|
|
if(true === $result){
|
|
return $this->success('删除成功',[],1,1);
|
|
}
|
|
return $this->fail($result);
|
|
}
|
|
|
|
} |