mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-08-29 20:29:47 +08:00
added 新增自动构建脚本
This commit is contained in:
parent
b9b33772b9
commit
c2ddf0ebb5
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
declare (strict_types=1);
|
declare (strict_types=1);
|
||||||
/**
|
/**
|
||||||
* 由ApiAdmin自动构建,请处理{$MODEL_NAME}!
|
* 由ApiAdmin自动构建,请处理{$MODEL_NAME}!
|
||||||
* @author apiadmin <apiadmin.org>
|
* @author apiadmin <apiadmin.org>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ use think\Response;
|
|||||||
|
|
||||||
class {$NAME} extends Base {
|
class {$NAME} extends Base {
|
||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
* @return \think\Response
|
* @return \think\Response
|
||||||
* @throws \think\db\exception\DbException
|
* @throws \think\db\exception\DbException
|
||||||
* @author apiadmin <apiadmin.org>
|
* @author apiadmin <apiadmin.org>
|
||||||
@ -32,7 +32,7 @@ class {$NAME} extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
* @return Response
|
* @return Response
|
||||||
* @author apiadmin <apiadmin.org>
|
* @author apiadmin <apiadmin.org>
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ class {$NAME} extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
* @return Response
|
* @return Response
|
||||||
* @author apiadmin <apiadmin.org>
|
* @author apiadmin <apiadmin.org>
|
||||||
*/
|
*/
|
||||||
@ -62,17 +62,17 @@ class {$NAME} extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
* @return Response
|
* @return Response
|
||||||
* @author apiadmin <apiadmin.org>
|
* @author apiadmin <apiadmin.org>
|
||||||
*/
|
*/
|
||||||
public function del(): Response {
|
public function del(): Response {
|
||||||
$id = $this->request->get('id');
|
$id = $this->request->get('id');
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
return $this->buildFailed(ReturnCode::EMPTY_PARAMS, '缺少必要参数');
|
return $this->buildFailed(ReturnCode::EMPTY_PARAMS, '缺少必要参数');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请处理部分删除数据
|
// 请处理部分删除数据
|
||||||
{$MODEL_NAME}::destroy(['id' => $id]);
|
{$MODEL_NAME}::destroy(['id' => $id]);
|
||||||
|
|
||||||
return $this->buildSuccess();
|
return $this->buildSuccess();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user