mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
d5686962a9
@ -72,8 +72,13 @@ class SystemCrud extends AuthController
|
||||
['fromField', []],
|
||||
['columnField', []],
|
||||
['filePath', []],
|
||||
['isTable', 0],
|
||||
]);
|
||||
|
||||
if (!$data['tableName']) {
|
||||
return app('json')->fail('缺少表名');
|
||||
}
|
||||
|
||||
$this->services->createCrud($data);
|
||||
|
||||
return app('json')->success('创建成功');
|
||||
@ -96,6 +101,14 @@ class SystemCrud extends AuthController
|
||||
['columnField', []],
|
||||
], true);
|
||||
|
||||
if (!$tableName) {
|
||||
return app('json')->fail('缺少表名');
|
||||
}
|
||||
|
||||
if (in_array($tableName, SystemCrudServices::NOT_CRUD_TABANAME)) {
|
||||
return app('json')->fail('不能生成系统自带数据表');
|
||||
}
|
||||
|
||||
$routeName = 'crud/' . Str::snake($tableName);
|
||||
|
||||
$make = $this->services->makeFile($tableName, $routeName, false, [
|
||||
|
||||
@ -42,6 +42,18 @@ use Phinx\Db\Adapter\MysqlAdapter;
|
||||
class SystemCrudServices extends BaseServices
|
||||
{
|
||||
|
||||
//不能生成的系统自带表
|
||||
const NOT_CRUD_TABANAME = [
|
||||
'system_config', 'system_attachment', 'system_attachment_category', 'system_config_tab',
|
||||
'system_admin', 'eb_system_city', 'system_log', 'system_menus', 'system_notice',
|
||||
'system_notice_admin', 'system_notification', 'system_role', 'system_route',
|
||||
'system_route_cate', 'system_storage', 'system_timer', 'system_user_level',
|
||||
'system_crud', 'wechat_key', 'user_label_relation', 'user_brokerage_frozen',
|
||||
'user_brokerage', 'store_product_cate', 'store_bargain_user_help', 'shipping_templates_region',
|
||||
'shipping_templates_no_delivery', 'shipping_templates_free', 'other_order_status', 'lang_code',
|
||||
'lang_country', 'app_version',
|
||||
];
|
||||
|
||||
/**
|
||||
* SystemCrudServices constructor.
|
||||
* @param SystemCrudDao $dao
|
||||
@ -151,10 +163,14 @@ class SystemCrudServices extends BaseServices
|
||||
$filePath = $data['filePath'];
|
||||
|
||||
//创建数据库
|
||||
if ($tableField) {
|
||||
if ($tableField && !$data['isTable']) {
|
||||
$this->makeDatebase($tableName, $tableComment, $tableField);
|
||||
}
|
||||
|
||||
if (in_array($tableName, self::NOT_CRUD_TABANAME)) {
|
||||
throw new ValidateException('不能生成系统自带数据表');
|
||||
}
|
||||
|
||||
//读取表结构
|
||||
$column = $this->getColumnNamesList($tableName);
|
||||
if (!$column) {
|
||||
@ -164,16 +180,19 @@ class SystemCrudServices extends BaseServices
|
||||
$routeName = 'crud/' . Str::snake($tableName);
|
||||
$uniqueAuth = $routeName . '-index-list';
|
||||
|
||||
$make = $this->makeFile($tableName, $routeName, true, $data, $filePath);
|
||||
$makePath = [];
|
||||
foreach ($make as $key => $item) {
|
||||
$makePath[$key] = $item['path'];
|
||||
foreach ($filePath as $k => $i) {
|
||||
if (in_array($k, ['pages', 'router', 'api'])) {
|
||||
$filePath[$k] = Make::adminTemplatePath() . $i;
|
||||
} else {
|
||||
$filePath[$k] = app()->getRootPath() . $i;
|
||||
}
|
||||
}
|
||||
|
||||
//创建菜单
|
||||
if (!$data['menuName']) {
|
||||
$data['menuName'] = $tableName;
|
||||
}
|
||||
$data = [
|
||||
$dataMenu = [
|
||||
'pid' => $data['pid'],
|
||||
'menu_name' => $data['menuName'],
|
||||
'menu_path' => '',
|
||||
@ -183,81 +202,94 @@ class SystemCrudServices extends BaseServices
|
||||
'unique_auth' => $uniqueAuth,
|
||||
'is_header' => $data['pid'] ? 0 : 1,
|
||||
];
|
||||
$menuInfo = app()->make(SystemMenusServices::class)->save($data);
|
||||
//写入路由权限
|
||||
$cateId = app()->make(SystemRouteServices::class)->topCateId('adminapi');
|
||||
$ruleData = [
|
||||
[
|
||||
'path' => $routeName,
|
||||
'method' => 'GET',
|
||||
'name' => $data['menuName'] . '列表接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/create',
|
||||
'method' => 'GET',
|
||||
'name' => $data['menuName'] . '获取创建表单接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName,
|
||||
'method' => 'POST',
|
||||
'name' => $data['menuName'] . '保存数据接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/<id>/edit',
|
||||
'method' => 'GET',
|
||||
'name' => $data['menuName'] . '获取修改表单接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/<id>',
|
||||
'method' => 'PUT',
|
||||
'name' => $data['menuName'] . '修改数据接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/<id>',
|
||||
'method' => 'DELETE',
|
||||
'name' => $data['menuName'] . '删除数据接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
];
|
||||
app()->make(SystemRouteServices::class)->saveAll($ruleData);
|
||||
//记录权限加入菜单表
|
||||
$menuData = [];
|
||||
foreach ($ruleData as $item) {
|
||||
$menuData[] = [
|
||||
'pid' => $menuInfo->id,
|
||||
'method' => $item['method'],
|
||||
'api_url' => $item['path'],
|
||||
'name' => $item['name'],
|
||||
'is_del' => 0,
|
||||
|
||||
$res = $this->transaction(function () use ($filePath, $tableName, $routeName, $data, $dataMenu) {
|
||||
$menuInfo = app()->make(SystemMenusServices::class)->save($dataMenu);
|
||||
//写入路由权限
|
||||
$cateId = app()->make(SystemRouteServices::class)->topCateId('adminapi');
|
||||
$ruleData = [
|
||||
[
|
||||
'path' => $routeName,
|
||||
'method' => 'GET',
|
||||
'name' => $data['menuName'] . '列表接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/create',
|
||||
'method' => 'GET',
|
||||
'name' => $data['menuName'] . '获取创建表单接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName,
|
||||
'method' => 'POST',
|
||||
'name' => $data['menuName'] . '保存数据接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/<id>/edit',
|
||||
'method' => 'GET',
|
||||
'name' => $data['menuName'] . '获取修改表单接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/<id>',
|
||||
'method' => 'PUT',
|
||||
'name' => $data['menuName'] . '修改数据接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'path' => $routeName . '/<id>',
|
||||
'method' => 'DELETE',
|
||||
'name' => $data['menuName'] . '删除数据接口',
|
||||
'app_name' => 'adminapi',
|
||||
'cate_id' => $cateId,
|
||||
'add_time' => date('Y-m-d H:i:s')
|
||||
],
|
||||
];
|
||||
}
|
||||
app()->make(SystemMenusServices::class)->saveAll($menuData);
|
||||
//记录crud生成
|
||||
$res = $this->dao->save([
|
||||
'pid' => $data['pid'],
|
||||
'name' => $data['menuName'],
|
||||
'table_name' => $tableName,
|
||||
'field' => json_encode($data),
|
||||
'make_path' => json_encode($makePath),
|
||||
'add_time' => time()
|
||||
]);
|
||||
app()->make(SystemRouteServices::class)->saveAll($ruleData);
|
||||
//记录权限加入菜单表
|
||||
$menuData = [];
|
||||
foreach ($ruleData as $item) {
|
||||
$menuData[] = [
|
||||
'pid' => $menuInfo->id,
|
||||
'method' => $item['method'],
|
||||
'api_url' => $item['path'],
|
||||
'name' => $item['name'],
|
||||
'is_del' => 0,
|
||||
];
|
||||
}
|
||||
app()->make(SystemMenusServices::class)->saveAll($menuData);
|
||||
|
||||
$make = $this->makeFile($tableName, $routeName, true, $data, $filePath);
|
||||
$makePath = [];
|
||||
foreach ($make as $key => $item) {
|
||||
$makePath[$key] = $item['path'];
|
||||
}
|
||||
|
||||
//记录crud生成
|
||||
$res = $this->dao->save([
|
||||
'pid' => $data['pid'],
|
||||
'name' => $data['menuName'],
|
||||
'table_name' => $tableName,
|
||||
'field' => json_encode($data),
|
||||
'make_path' => json_encode($makePath),
|
||||
'add_time' => time()
|
||||
]);
|
||||
|
||||
return $res;
|
||||
});
|
||||
|
||||
return $res->toArray();
|
||||
}
|
||||
|
||||
@ -323,41 +355,41 @@ class SystemCrudServices extends BaseServices
|
||||
$options['columnField'] = is_array($options['columnField']) ? $options['columnField'] : [];
|
||||
//生成控制器
|
||||
$controller = app()->make(Controller::class);
|
||||
[$controllerContent, $controllerPath] = $controller->setFilePathName($filePath['controller'] ?? '')->isMake($isMake)->handle($tableName, '/');
|
||||
[$controllerContent, $controllerPath] = $controller->setFilePathName($filePath['controller'] ?? '')->isMake($isMake)->handle($tableName);
|
||||
//生成模型
|
||||
$model = app()->make(Model::class);
|
||||
[$modelContent, $modelPath] = $model->setFilePathName($filePath['model'] ?? '')->isMake($isMake)->handle($tableName, '/');
|
||||
[$modelContent, $modelPath] = $model->setFilePathName($filePath['model'] ?? '')->isMake($isMake)->handle($tableName);
|
||||
//生成dao
|
||||
$dao = app()->make(Dao::class);
|
||||
[$daoContent, $daoPath] = $dao->setFilePathName($filePath['dao'] ?? '')->isMake($isMake)->handle($tableName, '/');
|
||||
[$daoContent, $daoPath] = $dao->setFilePathName($filePath['dao'] ?? '')->isMake($isMake)->handle($tableName);
|
||||
//生成路由
|
||||
$route = app()->make(Route::class);
|
||||
[$routeContent, $routePath] = $route->setFilePathName($filePath['route'] ?? '')->isMake($isMake)->handle($tableName, '/', [
|
||||
[$routeContent, $routePath] = $route->setFilePathName($filePath['route'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'menus' => $options['menuName'],
|
||||
'route' => $routeName
|
||||
]);
|
||||
//生成service
|
||||
$service = app()->make(Service::class);
|
||||
[$serviceContent, $servicePath] = $service->setFilePathName($filePath['service'] ?? '')->isMake($isMake)->handle($tableName, '/', [
|
||||
[$serviceContent, $servicePath] = $service->setFilePathName($filePath['service'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'field' => $options['fromField'],
|
||||
]);
|
||||
//生成验证器
|
||||
$validate = app()->make(Validate::class);
|
||||
[$validateContent, $validatePath] = $validate->setFilePathName($filePath['validate'] ?? '')->isMake($isMake)->handle($tableName, '/');
|
||||
[$validateContent, $validatePath] = $validate->setFilePathName($filePath['validate'] ?? '')->isMake($isMake)->handle($tableName);
|
||||
//生成前台路由
|
||||
$viewRouter = app()->make(ViewRouter::class);
|
||||
[$routerContent, $routerPath] = $viewRouter->setFilePathName($filePath['router'] ?? '')->isMake($isMake)->handle($tableName, '/', [
|
||||
[$routerContent, $routerPath] = $viewRouter->setFilePathName($filePath['router'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'route' => $routeName,
|
||||
]);
|
||||
//生成前台接口
|
||||
$viewApi = app()->make(ViewApi::class);
|
||||
[$apiContent, $apiPath] = $viewApi->setFilePathName($filePath['api'] ?? '')->isMake($isMake)->handle($tableName, '/', [
|
||||
[$apiContent, $apiPath] = $viewApi->setFilePathName($filePath['api'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'route' => $routeName,
|
||||
]);
|
||||
|
||||
//生成前台页面
|
||||
$viewPages = app()->make(ViewPages::class);
|
||||
[$pagesContent, $pagesPath] = $viewPages->setFilePathName($filePath['pages'] ?? '')->isMake($isMake)->handle($tableName, '/', [
|
||||
[$pagesContent, $pagesPath] = $viewPages->setFilePathName($filePath['pages'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'field' => $options['columnField']
|
||||
]);
|
||||
|
||||
|
||||
@ -49,8 +49,9 @@ class Controller extends Make
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/3/13
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
$path = $options['path'] ?? '';
|
||||
$contentPhp = '';
|
||||
$var = ["{%date%}"];
|
||||
$fieldPhp = [$this->value['date']];
|
||||
@ -98,7 +99,7 @@ class Controller extends Make
|
||||
|
||||
$filePath = $this->getFilePathName($path, $this->value['nameCamel']);
|
||||
|
||||
return [$this->makeFile($filePath, $contentStr), $filePath];
|
||||
return [$this->makeFile($filePath, $contentStr), $this->filePathName ?: $filePath];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -219,9 +219,9 @@ abstract class Make
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/3/13
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
|
||||
$path = $options['path'] ?? '';
|
||||
[$nameData, $content] = $this->getStubContent($name);
|
||||
|
||||
$this->value['name'] = $nameData;
|
||||
@ -236,7 +236,7 @@ abstract class Make
|
||||
|
||||
$filePath = $this->getFilePathName($path, $this->value['nameCamel']);
|
||||
|
||||
return [$this->makeFile($filePath, $contentStr), $filePath];
|
||||
return [$this->makeFile($filePath, $contentStr), $this->filePathName ?: $filePath];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -343,14 +343,15 @@ abstract class Make
|
||||
*/
|
||||
protected function getfolderPath(string $path)
|
||||
{
|
||||
$path = $path ?: $this->filePathName;
|
||||
$path = str_replace([$this->basePath, $this->baseDir], '', $path);
|
||||
$path = ltrim(str_replace('\\', '/', $path), '/');
|
||||
$pathArr = explode('/', $path);
|
||||
$count = count($pathArr);
|
||||
$res = $pathArr[$count - 1] ?? null;
|
||||
if ($pathArr && $res && $res == $this->name) {
|
||||
return '';
|
||||
array_pop($pathArr);
|
||||
if ($pathArr) {
|
||||
return '\\' . implode('\\', $pathArr);
|
||||
} else {
|
||||
return '\\' . $res;
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,13 @@ class Model extends Make
|
||||
return 'app' . DS . 'model' . DS . 'crud';
|
||||
}
|
||||
|
||||
protected function getFilePathName(string $path, string $name): string
|
||||
{
|
||||
$path = ltrim(str_replace('\\', '/', $path), '/');
|
||||
|
||||
return $this->getBasePath($path) . $name . '.' . $this->fileMime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板文件
|
||||
* @param string $type
|
||||
|
||||
@ -36,12 +36,12 @@ class Route extends Make
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $path
|
||||
* @param array $options
|
||||
* @return mixed|void
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
$path = $options['path'] ?? '';
|
||||
$action = $options['action'] ?? [];
|
||||
$route = $options['route'] ?? '';
|
||||
$controller = $options['controller'] ?? '';
|
||||
@ -67,14 +67,14 @@ class Route extends Make
|
||||
|
||||
$routeContent = "";
|
||||
foreach ($action as $item) {
|
||||
$routeContent .= $this->getStub($item) . "\r\n";
|
||||
$routeContent .= file_get_contents($this->getStub($item)) . "\r\n";
|
||||
}
|
||||
|
||||
if ($var && $value) {
|
||||
$routeContent = str_replace($var, $value, $routeContent);
|
||||
}
|
||||
|
||||
$content = $this->getStub();
|
||||
$content = file_get_contents($this->getStub());
|
||||
|
||||
$this->value['content-php'] = $routeContent;
|
||||
|
||||
@ -82,16 +82,16 @@ class Route extends Make
|
||||
|
||||
$filePath = $this->getFilePathName($path, strtolower($name));
|
||||
|
||||
return [$this->makeFile($filePath, $contentStr), $filePath];
|
||||
return [$this->makeFile($filePath, $contentStr), $this->filePathName ?: $filePath];
|
||||
}
|
||||
|
||||
/**
|
||||
* @author 等风来
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/11
|
||||
* @param string $path
|
||||
* @param string $name
|
||||
* @return string
|
||||
* @author 等风来
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/11
|
||||
*/
|
||||
protected function getFilePathName(string $path, string $name): string
|
||||
{
|
||||
|
||||
@ -36,15 +36,15 @@ class Service extends Make
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $path
|
||||
* @param array $options
|
||||
* @return mixed|void
|
||||
* @author 等风来
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/3/23
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
$path = $options['path'] ?? '';
|
||||
|
||||
$this->value['use-php'] = $this->getDaoClassName($name, $path);
|
||||
|
||||
@ -92,7 +92,7 @@ class Service extends Make
|
||||
|
||||
$filePath = $this->getFilePathName($path, $this->value['nameCamel']);
|
||||
|
||||
return [$this->makeFile($filePath, $contentStr), $filePath];
|
||||
return [$this->makeFile($filePath, $contentStr), $this->filePathName ?: $filePath];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -60,16 +60,15 @@ class ViewApi extends Make
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $path
|
||||
* @param array $options
|
||||
* @return array
|
||||
* @author 等风来
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/4
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
|
||||
$path = $options['path'] ?? '';
|
||||
$action = $options['action'] ?? [];
|
||||
if (!$action) {
|
||||
$action = ['index', 'create', 'save', 'edit', 'update'];
|
||||
@ -103,7 +102,7 @@ class ViewApi extends Make
|
||||
|
||||
$content = $this->makeFile($filePath, $contentStr);
|
||||
|
||||
return [$content, $filePath];
|
||||
return [$content, $this->filePathName ?: $filePath];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -66,20 +66,20 @@ class ViewPages extends Make
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/3
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
$field = $options['field'] ?? [];
|
||||
|
||||
$columnStr = [];
|
||||
foreach ($field as $item) {
|
||||
$columnStr[] = "{\n\"title:\"{$item['name']},\n\"key:\"{$item['field']}\n}";
|
||||
$columnStr[] = $this->tab() . "{\ntitle:\"{$item['name']}\",\nkey:\"{$item['field']}\"\n}";
|
||||
}
|
||||
$this->value['auth'] = Str::snake($name);
|
||||
$this->value['content-vue'] = "\n" . implode(',', $columnStr);
|
||||
$this->value['pathApiJs'] = $options['pathApiJs'] ?? '';
|
||||
$this->value['nameCamel'] = Str::snake($name, '-');
|
||||
|
||||
return parent::handle($name, $path, $options);
|
||||
return parent::handle($name, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -66,8 +66,9 @@ class ViewRouter extends Make
|
||||
* @email 136327134@qq.com
|
||||
* @date 2023/4/4
|
||||
*/
|
||||
public function handle(string $name, string $path, array $options = [])
|
||||
public function handle(string $name, array $options = [])
|
||||
{
|
||||
$path = $options['path'] ?? '';
|
||||
[$nameData, $content] = $this->getStubContent($name);
|
||||
|
||||
$menus = $options['menus'] ?? $name;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @date {%time%}
|
||||
*/
|
||||
|
||||
namespace app\adminapi\controller\v1{%path%};
|
||||
namespace app\adminapi\controller\crud{%path%};
|
||||
|
||||
use app\adminapi\controller\AuthController;
|
||||
use think\facade\App;
|
||||
@ -24,7 +24,7 @@ use think\facade\App;
|
||||
/**
|
||||
* Class {%nameCamel%}
|
||||
* @date {%date%}
|
||||
* @package app\adminapi\controller\v1{%path%}
|
||||
* @package app\adminapi\controller\crud{%path%}
|
||||
*/
|
||||
class {%nameCamel%} extends AuthController
|
||||
{
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @date {%time%}
|
||||
*/
|
||||
|
||||
namespace app\dao{%path%};
|
||||
namespace app\dao\crub{%path%};
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
@ -24,7 +24,7 @@ use app\dao\BaseDao;
|
||||
/**
|
||||
* Class {%nameCamel%}Dao
|
||||
* @date {%date%}
|
||||
* @package app\dao{%path%}
|
||||
* @package app\dao\crub{%path%}
|
||||
*/
|
||||
class {%nameCamel%}Dao extends BaseDao
|
||||
{
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @date {%time%}
|
||||
*/
|
||||
|
||||
namespace app\model{%path%};
|
||||
namespace app\model\crud{%path%};
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
@ -24,7 +24,7 @@ use crmeb\basic\BaseModel;
|
||||
/**
|
||||
* Class {%nameCamel%}
|
||||
* @date {%date%}
|
||||
* @package app\model{%path%}
|
||||
* @package app\model\crud{%path%}
|
||||
*/
|
||||
class {%nameCamel%} extends BaseModel
|
||||
{
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @date {%time%}
|
||||
*/
|
||||
|
||||
namespace app\services{%path%};
|
||||
namespace app\services\crub{%path%};
|
||||
|
||||
use app\services\BaseServices;
|
||||
use think\exception\ValidateException;
|
||||
@ -25,7 +25,7 @@ use think\exception\ValidateException;
|
||||
/**
|
||||
* Class CrudService
|
||||
* @date {%date%}
|
||||
* @package app\services{%path%}
|
||||
* @package app\services\crub{%path%}
|
||||
*/
|
||||
class {%nameCamel%}Service extends BaseServices
|
||||
{
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* @date {%time%}
|
||||
*/
|
||||
|
||||
namespace app\adminapi\validate{%path%};
|
||||
namespace app\adminapi\validate\crub{%path%};
|
||||
|
||||
|
||||
use think\Validate;
|
||||
@ -24,7 +24,7 @@ use think\Validate;
|
||||
/**
|
||||
* Class CrudValidate
|
||||
* @date {%date%}
|
||||
* @package app\adminapi\validate{%path%}
|
||||
* @package app\adminapi\validate\crub{%path%}
|
||||
*/
|
||||
class {%nameCamel%}Validate extends Validate
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user