From 92cadfff9563c21cf89dcddc8ed7a4ae624c63ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=99=E6=84=8F?= Date: Fri, 18 Apr 2025 10:57:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9E=9A=E4=B8=BE=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=AD=97=E5=85=B8=20MySql=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=EF=BC=8C=E8=BF=9E=E6=8E=A5=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=8A=A0=E4=B8=8A=20AllowUserVariables=3Dtru?= =?UTF-8?q?e;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Enum/SysEnumService.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs b/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs index 526f70ff..edf0a2d6 100644 --- a/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Enum/SysEnumService.cs @@ -31,7 +31,8 @@ public class SysEnumService : IDynamicApiController, ITransient public List GetEnumTypeList() { var enumTypeList = App.EffectiveTypes.Where(t => t.IsEnum) - .Where(t => _enumOptions.EntityAssemblyNames.Contains(t.Assembly.GetName().Name) || _enumOptions.EntityAssemblyNames.Any(name => t.Assembly.GetName().Name.Contains(name))) + .Where(t => _enumOptions.EntityAssemblyNames.Contains(t.Assembly.GetName().Name) || + _enumOptions.EntityAssemblyNames.Any(name => t.Assembly.GetName().Name.Contains(name))) .Where(t => t.GetCustomAttributes(typeof(ErrorCodeTypeAttribute), false).Length == 0) // 排除错误代码类型 .OrderBy(u => u.Name).ThenBy(u => u.FullName) .ToList(); @@ -53,6 +54,7 @@ public class SysEnumService : IDynamicApiController, ITransient var att = ((DescriptionAttribute[])attrs)[0]; description = att.Description; } + var enumType = App.EffectiveTypes.FirstOrDefault(t => t.IsEnum && t.Name == type.Name); return new EnumTypeOutput { @@ -124,13 +126,11 @@ public class SysEnumService : IDynamicApiController, ITransient var (newDictTypes, newDictDatas) = GetNewSysDicts(newEnumType); // 若是Sqlite、PostgreSQL、SqlServer、MySql、GaussDB、Kdbndp则采用批量处理 - bool enableBulk = _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.Sqlite - || _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.PostgreSQL - || _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.SqlServer; - //|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.MySql - //|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.MySqlConnector - //|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.GaussDB - //|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.Kdbndp; + bool enableBulk = _db.CurrentConnectionConfig.DbType is SqlSugar.DbType.Sqlite or SqlSugar.DbType.PostgreSQL + or SqlSugar.DbType.SqlServer or SqlSugar.DbType.MySql; + // or SqlSugar.DbType.MySqlConnector + // or SqlSugar.DbType.GaussDB + // or SqlSugar.DbType.Kdbndp; // 执行数据库操作 if (updatedDictTypes.Count > 0)