Merge branch 'v2' of https://code.adminnet.top/Admin.NET/Admin.NET.Pro into v2
This commit is contained in:
commit
3fba4b5cd6
@ -31,7 +31,8 @@ public class SysEnumService : IDynamicApiController, ITransient
|
|||||||
public List<EnumTypeOutput> GetEnumTypeList()
|
public List<EnumTypeOutput> GetEnumTypeList()
|
||||||
{
|
{
|
||||||
var enumTypeList = App.EffectiveTypes.Where(t => t.IsEnum)
|
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) // 排除错误代码类型
|
.Where(t => t.GetCustomAttributes(typeof(ErrorCodeTypeAttribute), false).Length == 0) // 排除错误代码类型
|
||||||
.OrderBy(u => u.Name).ThenBy(u => u.FullName)
|
.OrderBy(u => u.Name).ThenBy(u => u.FullName)
|
||||||
.ToList();
|
.ToList();
|
||||||
@ -53,6 +54,7 @@ public class SysEnumService : IDynamicApiController, ITransient
|
|||||||
var att = ((DescriptionAttribute[])attrs)[0];
|
var att = ((DescriptionAttribute[])attrs)[0];
|
||||||
description = att.Description;
|
description = att.Description;
|
||||||
}
|
}
|
||||||
|
|
||||||
var enumType = App.EffectiveTypes.FirstOrDefault(t => t.IsEnum && t.Name == type.Name);
|
var enumType = App.EffectiveTypes.FirstOrDefault(t => t.IsEnum && t.Name == type.Name);
|
||||||
return new EnumTypeOutput
|
return new EnumTypeOutput
|
||||||
{
|
{
|
||||||
@ -124,13 +126,11 @@ public class SysEnumService : IDynamicApiController, ITransient
|
|||||||
var (newDictTypes, newDictDatas) = GetNewSysDicts(newEnumType);
|
var (newDictTypes, newDictDatas) = GetNewSysDicts(newEnumType);
|
||||||
|
|
||||||
// 若是Sqlite、PostgreSQL、SqlServer、MySql、GaussDB、Kdbndp则采用批量处理
|
// 若是Sqlite、PostgreSQL、SqlServer、MySql、GaussDB、Kdbndp则采用批量处理
|
||||||
bool enableBulk = _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.Sqlite
|
bool enableBulk = _db.CurrentConnectionConfig.DbType is SqlSugar.DbType.Sqlite or SqlSugar.DbType.PostgreSQL
|
||||||
|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.PostgreSQL
|
or SqlSugar.DbType.SqlServer or SqlSugar.DbType.MySql;
|
||||||
|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.SqlServer;
|
// or SqlSugar.DbType.MySqlConnector
|
||||||
//|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.MySql
|
// or SqlSugar.DbType.GaussDB
|
||||||
//|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.MySqlConnector
|
// or SqlSugar.DbType.Kdbndp;
|
||||||
//|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.GaussDB
|
|
||||||
//|| _db.CurrentConnectionConfig.DbType == SqlSugar.DbType.Kdbndp;
|
|
||||||
|
|
||||||
// 执行数据库操作
|
// 执行数据库操作
|
||||||
if (updatedDictTypes.Count > 0)
|
if (updatedDictTypes.Count > 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user