企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` // 引入框架内置类 use think\App; use think\exception\HttpResponseException; use think\exception\ValidateException; use think\facade\Config; use think\facade\Request; use think\facade\View; use think\Response; use think\Validate; // 引入表格和表单构建器 use app\common\builder\FormBuilder; use app\common\builder\TableBuilder; use app\common\facade\MakeBuilder; initialize() /** * 验证数据 * @access protected * @param array $data 数据 * @param string|array $validate 验证器名或者验证规则数组 * @param array $message 提示信息 * @param bool $batch 是否批量验证 * @return array|string|true * @throws ValidateException */ protected function validate(array $data, $validate, array $message = [], bool $batch = false) /** * 操作错误跳转 * @param mixed $msg 提示信息 * @param string $url 跳转的URL地址 * @param mixed $data 返回的数据 * @param integer $wait 跳转等待时间 * @param array $header 发送的Header信息 * @return void */ protected function error($msg = '', string $url = null, $data = '', int $wait = 3, array $header = []): Response /** * 返回封装后的API数据到客户端 * @param mixed $data 要返回的数据 * @param integer $code 返回的code * @param mixed $msg 提示信息 * @param string $type 返回数据格式 * @param array $header 发送的Header信息 * @return Response */ protected function result($data, int $code = 0, $msg = '', string $type = '', array $header = []): Response /** * 操作成功跳转 * @param mixed $msg 提示信息 * @param string $url 跳转的URL地址 * @param mixed $data 返回的数据 * @param integer $wait 跳转等待时间 * @param array $header 发送的Header信息 * @return void */ protected function success($msg = '', string $url = null, $data = '', int $wait = 3, array $header = []): Response /** * 跳转页 * @param string $url * @return Response */ protected function jump(string $url = '') // 列表 public function index() // 添加 public function add() // 添加保存 public function addPost() // 修改 public function edit(string $id) // 修改保存 public function editPost() // 删除 public function del(string $id) // 批量删除 public function selectDel(string $id) // 排序 public function sort() // 状态变更 public function state(string $id) // 导出 public function export() ```