refactor: remove unused backend extensions
This commit is contained in:
@@ -11,6 +11,45 @@ namespace Admin.NET.Core;
|
||||
|
||||
public static class SqlSugarSetup
|
||||
{
|
||||
// 仅自动维护后台通用底座表;支付、LDAP、代码生成等扩展按需再接入。
|
||||
private static readonly HashSet<string> RetainedSystemEntities = new(StringComparer.Ordinal)
|
||||
{
|
||||
"SysConfig",
|
||||
"SysDictData",
|
||||
"SysDictDataTenant",
|
||||
"SysDictType",
|
||||
"SysFile",
|
||||
"SysFileProvider",
|
||||
"SysLang",
|
||||
"SysLangText",
|
||||
"SysLogDiff",
|
||||
"SysLogEx",
|
||||
"SysLogOp",
|
||||
"SysLogVis",
|
||||
"SysMenu",
|
||||
"SysNotice",
|
||||
"SysNoticeUser",
|
||||
"SysOnlineUser",
|
||||
"SysOpenAccess",
|
||||
"SysOrg",
|
||||
"SysPos",
|
||||
"SysRegion",
|
||||
"SysRole",
|
||||
"SysRoleMenu",
|
||||
"SysRoleOrg",
|
||||
"SysTemplate",
|
||||
"SysTenant",
|
||||
"SysTenantConfig",
|
||||
"SysTenantConfigData",
|
||||
"SysTenantMenu",
|
||||
"SysUser",
|
||||
"SysUserConfig",
|
||||
"SysUserConfigData",
|
||||
"SysUserExtOrg",
|
||||
"SysUserMenu",
|
||||
"SysUserRegWay",
|
||||
"SysUserRole",
|
||||
};
|
||||
// 多租户实例
|
||||
public static ITenant ITenant { get; set; }
|
||||
|
||||
@@ -445,6 +484,8 @@ public static class SqlSugarSetup
|
||||
return App.EffectiveTypes
|
||||
.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false))
|
||||
.Where(u => !u.GetCustomAttributes<IgnoreTableAttribute>().Any())
|
||||
.Where(u => RetainedSystemEntities.Contains(u.Name) ||
|
||||
(u.Namespace?.StartsWith("Evergreen.Health.Application.Health", StringComparison.Ordinal) ?? false))
|
||||
.WhereIF(config.TableSettings.EnableIncreTable, u => u.IsDefined(typeof(IncreTableAttribute), false))
|
||||
.Where(u => IsEntityForConfig(u, config))
|
||||
.ToList();
|
||||
@@ -686,6 +727,8 @@ public static class SqlSugarSetup
|
||||
// 获取所有业务表-初始化租户库表结构(排除系统表、日志表、特定库表)
|
||||
var entityTypes = App.EffectiveTypes
|
||||
.Where(u => !u.GetCustomAttributes<IgnoreTableAttribute>().Any())
|
||||
.Where(u => RetainedSystemEntities.Contains(u.Name) ||
|
||||
(u.Namespace?.StartsWith("Evergreen.Health.Application.Health", StringComparison.Ordinal) ?? false))
|
||||
.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false) &&
|
||||
!u.IsDefined(typeof(SysTableAttribute), false) && !u.IsDefined(typeof(LogTableAttribute), false) && !u.IsDefined(typeof(TenantAttribute), false)).ToList();
|
||||
if (entityTypes.Count == 0) return;
|
||||
|
||||
Reference in New Issue
Block a user