新增表基类3

This commit is contained in:
FalconFly 2024-01-22 14:34:14 +08:00
parent a8d947bc7f
commit 33f9ae8368

View File

@ -0,0 +1,29 @@
using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations;
namespace Falcon.SugarApi.DatabaseDefinitions
{
/// <summary>
/// 数据表基类。提供字符串主键,记录状态和创建时间
/// </summary>
public abstract class SugarBasicTable3
{
/// <summary>
/// 主键 默认GUID 382c74c3-721d-4f34-80e5-57657b6cbc27
/// </summary>
[SugarColumn(IsPrimaryKey = true,ColumnDescription = "主键")]
[MaxLength(36)]
public string Id { get; set; } = Guid.NewGuid().ToString();
/// <summary>
/// 记录状态
/// </summary>
[Required, MaxLength(10)]
public string? RecordStatus { get; set; } = RecordStetus.Effective;
/// <summary>
/// 创建时间
/// </summary>
[Required,SugarColumn(ColumnDescription = "创建时间")]
public DateTime CreateTime { get; set; } = DateTime.Now;
}
}