diff --git a/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs b/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs index f96fe12..67a708a 100644 --- a/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs +++ b/Falcon.SugarApi/DatabaseDefinitions/SugarBasicTable2.cs @@ -10,16 +10,16 @@ namespace Falcon.SugarApi.DatabaseDefinitions public abstract class SugarBasicTable2 { /// - /// 主键 + /// 主键 默认GUID 382c74c3-721d-4f34-80e5-57657b6cbc27 /// [SugarColumn(IsPrimaryKey = true,ColumnDescription = "主键")] - public string Id { get; set; } = ""; + [MaxLength(36)] + public string Id { get; set; } = Guid.NewGuid().ToString(); /// /// 创建时间 /// [Required] [SugarColumn(ColumnDescription = "创建时间")] public DateTime CreateTime { get; set; } = DateTime.Now; - } }