You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
4.1 KiB
143 lines
4.1 KiB
using SqlSugar;
|
|
using System;
|
|
|
|
namespace Wood.Entity;
|
|
|
|
/// <summary>
|
|
/// 框架实体基类Id
|
|
/// </summary>
|
|
public abstract class EntityIdBase
|
|
{
|
|
/// <summary>
|
|
/// 雪花Id
|
|
/// 如果没有赋值则会自动生成,值为[null,0]时会自动生成
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "Id", IsPrimaryKey = true, IsIdentity = false)]
|
|
public virtual long Id { get; set; }
|
|
}
|
|
|
|
#region 非租户
|
|
/// <summary>
|
|
/// 框架实体基类 创建
|
|
/// </summary>
|
|
public abstract class EntityCreateBase : EntityIdBase, ICreateUserIdFilter
|
|
{
|
|
/// <summary>
|
|
/// 创建者Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
|
public virtual long? CreateUserId { get; set; }
|
|
/// <summary>
|
|
/// 创建时间
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
|
public virtual DateTime? CreateTime { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 框架实体基类
|
|
/// 包括 创建者信息,修改者信息,删除标记
|
|
/// </summary>
|
|
public abstract class EntityBase : EntityIdBase, IDeletedFilter, IOrgIdFilter, ICreateUserIdFilter
|
|
{
|
|
/// <summary>
|
|
/// 创建者部门Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "创建者部门Id", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
|
public virtual long? CreateOrgId { get; set; }
|
|
/// <summary>
|
|
/// 创建时间
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
|
public virtual DateTime? CreateTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 创建者Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
|
public virtual long? CreateUserId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 更新时间
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "更新时间", IsOnlyIgnoreInsert = true, IsNullable = true)]
|
|
public virtual DateTime? UpdateTime { get; set; }
|
|
|
|
/// <summary>
|
|
/// 修改者Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "修改者Id", IsOnlyIgnoreInsert = true, IsNullable = true)]
|
|
public virtual long? UpdateUserId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 软删除
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "软删除")]
|
|
public virtual bool IsDelete { get; set; } = false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 框架实体基类
|
|
/// 包括 创建者信息,修改者信息,删除标记
|
|
/// 额外包括 状态 Status 1有效 0无效
|
|
/// 额外包括 备注 Remark
|
|
/// </summary>
|
|
public abstract class EntityBaseExtra : EntityBase,IStatusFilter
|
|
{
|
|
/// <summary>
|
|
/// 状态
|
|
/// 1有效 0无效
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "状态 1有效 0无效", DefaultValue = "1")]
|
|
public int Status { get; set; } = 1;
|
|
|
|
/// <summary>
|
|
/// 备注
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "备注", Length = 128,IsNullable =true)]
|
|
public string? Remark { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
#region 租户
|
|
|
|
/// <summary>
|
|
/// 框架实体基类
|
|
/// 包括 租户信息,创建者信息,修改者信息,删除标记
|
|
/// </summary>
|
|
public abstract class EntityTenantBase : EntityBase, ITenantIdFilter
|
|
{
|
|
/// <summary>
|
|
/// 租户Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true, IsNullable = true,DefaultValue ="0")]
|
|
public virtual long TenantId { get; set; } = 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 框架实体基类
|
|
/// 包括 租户信息,创建者信息,修改者信息,删除标记
|
|
/// 额外包括 状态 Status 1有效 0无效
|
|
/// 额外包括 备注 Remark
|
|
/// </summary>
|
|
public abstract class EntityTenantBaseExtra : EntityBaseExtra, ITenantIdFilter
|
|
{
|
|
/// <summary>
|
|
/// 租户Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true, IsNullable = true, DefaultValue = "0")]
|
|
public virtual long TenantId { get; set; } = 0;
|
|
}
|
|
/// <summary>
|
|
/// 框架实体基类
|
|
/// 包括 租户信息,创建者信息
|
|
/// </summary>
|
|
public abstract class EntityTenantCreateBase : EntityCreateBase, ITenantIdFilter
|
|
{
|
|
/// <summary>
|
|
/// 租户Id
|
|
/// </summary>
|
|
[SugarColumn(ColumnDescription = "租户Id", IsOnlyIgnoreUpdate = true, IsNullable = true)]
|
|
public virtual long TenantId { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
|