mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
优化功能,通知功能,任务功能
This commit is contained in:
50
resource/template/sql/sql.template
Normal file
50
resource/template/sql/sql.template
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
==========================================================================
|
||||
GFast自动生成菜单SQL,只生成一次,按需修改.
|
||||
生成日期:{{.table.CreateTime}}
|
||||
生成路径: data/gen_sql/{{.table.ModuleName}}/{{.table.BusinessName}}_menu.sql
|
||||
生成人:{{.table.FunctionAuthor}}
|
||||
==========================================================================
|
||||
*/
|
||||
|
||||
{{$plugin:=""}}
|
||||
{{if ContainsI $.table.PackageName "plugins"}}
|
||||
{{$plugin = "plugins/"}}
|
||||
{{end}}
|
||||
|
||||
-- 当前日期
|
||||
select @now := now();
|
||||
|
||||
-- 目录 SQL
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(0,'{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}','{{.table.FunctionName}}管理','form','','{{.table.FunctionName}}管理',0,0,1,1,'{{$plugin}}{{.table.BusinessName | CaseCamelLower}}','','',0,'sys_admin',0,@now,@now,NULL );
|
||||
|
||||
-- 菜单父目录ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 菜单 SQL
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(@parentId,'{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}/list','{{.table.FunctionName}}列表','list','','{{.table.FunctionName}}列表',1,0,1,1,'{{.table.BusinessName | CaseCamelLower}}List','','{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}/list',0,'sys_admin',0,@now,@now,NULL );
|
||||
|
||||
-- 按钮父目录ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(@parentId,'{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}/get','{{.table.FunctionName}}查询','','','{{.table.FunctionName}}查询',2,0,1,1,'','','',0,'sys_admin',0,@now,@now,NULL );
|
||||
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(@parentId,'{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}/add','{{.table.FunctionName}}添加','','','{{.table.FunctionName}}添加',2,0,1,1,'','','',0,'sys_admin',0,@now,@now,NULL );
|
||||
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(@parentId,'{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}/edit','{{.table.FunctionName}}修改','','','{{.table.FunctionName}}修改',2,0,1,1,'','','',0,'sys_admin',0,@now,@now,NULL );
|
||||
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(@parentId,'{{$plugin}}{{.table.ModuleName}}/{{.table.BusinessName | CaseCamelLower}}/delete','{{.table.FunctionName}}删除','','','{{.table.FunctionName}}删除',2,0,1,1,'','','',0,'sys_admin',0,@now,@now,NULL );
|
||||
|
||||
{{range $index,$column:= .table.Columns}}
|
||||
{{if and (HasSuffix $column.ColumnName "status") (eq $column.IsList "1") }}
|
||||
INSERT INTO `sys_auth_rule` (`pid`,`name`,`title`,`icon`,`condition`,`remark`,`menu_type`,`weigh`,`status`,`always_show`,`path`,`jump_path`,`component`,`is_frame`,`module_type`,`model_id`,`created_at`,`updated_at`,`deleted_at` )
|
||||
VALUES(@parentId,'{{$plugin}}{{$.table.ModuleName}}/{{$.table.BusinessName | CaseCamelLower}}/change{{$column.GoField}}','{{$.table.FunctionName}}{{$column.ColumnComment}}修改','','','{{$.table.FunctionName}}{{$column.ColumnComment}}修改',2,0,1,1,'','','',0,'sys_admin',0,@now,@now,NULL );
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user