diff --git a/OpenAuth.App/Base/BaseLongApp.cs b/OpenAuth.App/Base/BaseLongApp.cs index e7175898..9317e60c 100644 --- a/OpenAuth.App/Base/BaseLongApp.cs +++ b/OpenAuth.App/Base/BaseLongApp.cs @@ -27,12 +27,12 @@ namespace OpenAuth.App /// 按id批量删除 /// /// - public void Delete(long[] ids) + public void Delete(decimal[] ids) { Repository.Delete(u => ids.Contains(u.Id)); } - public T Get(long id) + public T Get(decimal id) { return Repository.FirstOrDefault(u => u.Id == id); } diff --git a/OpenAuth.App/BuilderTable/BuilderTableApp.cs b/OpenAuth.App/BuilderTable/BuilderTableApp.cs index 256b1c6d..4d445044 100644 --- a/OpenAuth.App/BuilderTable/BuilderTableApp.cs +++ b/OpenAuth.App/BuilderTable/BuilderTableApp.cs @@ -275,7 +275,7 @@ namespace OpenAuth.App { throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段"); } - if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字 + if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字 { if(primarykey.IsIncrement) //是否自增 { @@ -386,7 +386,7 @@ namespace OpenAuth.App { throw new Exception($"未能找到表{sysTableInfo.TableName}的主键字段"); } - if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字 + if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字 { if(primarykey.IsIncrement) //是否自增 { @@ -394,7 +394,7 @@ namespace OpenAuth.App } else //普通的雪花算法生成id { - domainContent = domainContent.Replace("{KeyTypeName}", "long"); + domainContent = domainContent.Replace("{KeyTypeName}", "decimal"); } } else @@ -458,7 +458,7 @@ namespace OpenAuth.App { throw new Exception($"未能找到表{tableInfo.TableName}的主键字段"); } - if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numberic") //是否为数字 + if (primarykey.ColumnType == "decimal" || primarykey.ColumnType == "numeric") //是否为数字 { if(primarykey.IsIncrement) //是否自增 { diff --git a/OpenAuth.Repository/Core/LongEntity.cs b/OpenAuth.Repository/Core/LongEntity.cs index bbc4ec22..26c09441 100644 --- a/OpenAuth.Repository/Core/LongEntity.cs +++ b/OpenAuth.Repository/Core/LongEntity.cs @@ -10,7 +10,7 @@ namespace OpenAuth.Repository.Core public class LongEntity :BaseEntity { [Browsable(false)] - public long Id { get; set; } + public decimal Id { get; set; } public override bool KeyIsNull() { return Id == 0;