diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable.cs index 9025505..afe1ea0 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable.cs @@ -12,13 +12,13 @@ namespace Falcon.SugarApi.DatabaseDefinitions /// /// 主键 /// - [SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键")] + [SugarColumn(IsPrimaryKey = true,ColumnDescription = "主键")] public Guid Id { get; set; } = Guid.NewGuid(); /// /// 创建时间 /// [Required] - [SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")] + [SugarColumn(IsOnlyIgnoreUpdate = true,ColumnDescription = "创建时间")] public DateTime CreateTime { get; set; } = DateTime.Now; /// diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs new file mode 100644 index 0000000..f96fe12 --- /dev/null +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs @@ -0,0 +1,25 @@ +using SqlSugar; +using System; +using System.ComponentModel.DataAnnotations; + +namespace Falcon.SugarApi.DatabaseDefinitions +{ + /// + /// 数据表基类 + /// + public abstract class SugarBasicTable2 + { + /// + /// 主键 + /// + [SugarColumn(IsPrimaryKey = true,ColumnDescription = "主键")] + public string Id { get; set; } = ""; + /// + /// 创建时间 + /// + [Required] + [SugarColumn(ColumnDescription = "创建时间")] + public DateTime CreateTime { get; set; } = DateTime.Now; + + } +}