1
0
mirror of https://gitee.com/apiadmin/ApiAdmin.git synced 2025-04-06 03:58:00 +08:00

added 新增自动构建脚本

This commit is contained in:
zhaoxiang 2021-02-24 18:55:23 +08:00
parent b9b33772b9
commit c2ddf0ebb5

@ -1,7 +1,7 @@
<?php
declare (strict_types=1);
/**
* 由ApiAdmin自动构建请处理{$MODEL_NAME}
* 由ApiAdmin自动构建请处理{$MODEL_NAME}
* @author apiadmin <apiadmin.org>
*/
@ -13,7 +13,7 @@ use think\Response;
class {$NAME} extends Base {
/**
* 获取
* 获取
* @return \think\Response
* @throws \think\db\exception\DbException
* @author apiadmin <apiadmin.org>
@ -32,7 +32,7 @@ class {$NAME} extends Base {
}
/**
* 添加
* 添加
* @return Response
* @author apiadmin <apiadmin.org>
*/
@ -47,7 +47,7 @@ class {$NAME} extends Base {
}
/**
* 编辑
* 编辑
* @return Response
* @author apiadmin <apiadmin.org>
*/
@ -62,17 +62,17 @@ class {$NAME} extends Base {
}
/**
* 删除
* 删除
* @return Response
* @author apiadmin <apiadmin.org>
*/
public function del(): Response {
$id = $this->request->get('id');
if (!$id) {
return $this->buildFailed(ReturnCode::EMPTY_PARAMS, '缺少必要参数');
return $this->buildFailed(ReturnCode::EMPTY_PARAMS, '缺少必要参数');
}
// 请处理部分删除数据
// 请处理部分删除数据
{$MODEL_NAME}::destroy(['id' => $id]);
return $this->buildSuccess();