You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.1 KiB
C#

12 months ago
using System.ComponentModel;
using SqlSugar;
12 months ago
namespace DS.Module.Core.Data;
/// <summary>
/// 实体类基类
/// </summary>
public abstract class BaseModel<TKey> : IDeleted
12 months ago
{
/// <summary>
/// 主键ID
/// </summary>
[Description("主键ID")]
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键ID")]
12 months ago
public TKey Id { get; set; }
/// <summary>
/// 备注
/// </summary>
[Description("备注")]
[SugarColumn(IsNullable = true, ColumnDescription = "备注", Length = 200)]
12 months ago
public string Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Description("创建时间")]
[SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
11 months ago
public DateTime CreateTime { get; set; }
12 months ago
/// <summary>
/// 创建人
/// </summary>
[Description("创建人")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")]
9 months ago
public long CreateBy { get; set; }
12 months ago
/// <summary>
/// 修改人
/// </summary>
[Description("修改人")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人")]
9 months ago
public long UpdateBy { get; set; }
12 months ago
/// <summary>
/// 更新时间
/// </summary>
[Description("更新时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "更新时间")]
12 months ago
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除
/// </summary>
[Description("删除")]
[SugarColumn(ColumnDescription = "是否删除")]
10 months ago
public bool Deleted { get; set; } = false;
12 months ago
/// <summary>
/// 删除时间
/// </summary>
[Description("删除时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除时间")]
12 months ago
public DateTime DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
[Description("删除人")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人")]
9 months ago
public long DeleteBy { get; set; }
11 months ago
// /// <summary>
// /// 租户Id
// /// </summary>
// [SqlSugar.SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true)]
// public long TenantId { get; set; } = 0;
}
/// <summary>
/// 实体类基类
/// </summary>
public abstract class BaseModelV2<TKey> : IDeleted
{
/// <summary>
/// 主键ID
/// </summary>
[Description("主键ID")]
[SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键ID")]
public TKey Id { get; set; }
/// <summary>
/// 备注
/// </summary>
[Description("备注")]
[SugarColumn(IsNullable = true, ColumnDescription = "备注", Length = 200)]
public string? Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Description("创建时间")]
[SqlSugar.SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Description("创建人")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人")]
public long CreateBy { get; set; }
/// <summary>
/// 修改人
/// </summary>
[Description("修改人")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人")]
public long? UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Description("更新时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "更新时间")]
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 删除
/// </summary>
[Description("删除")]
[SugarColumn(ColumnDescription = "是否删除", DefaultValue = "0")]
public bool Deleted { get; set; }
/// <summary>
/// 删除时间
/// </summary>
[Description("删除时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除时间")]
public DateTime? DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
[Description("删除人")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人")]
public long? DeleteBy { get; set; }
12 months ago
}