Files
KinginfoGateway/framework/ThingsGateway.Admin.Core/Entity/BaseEntity.cs
2023-08-07 22:30:38 +08:00

104 lines
3.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#region copyright
//------------------------------------------------------------------------------
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
// 此代码版权除特别声明外的代码归作者本人Diego所有
// 源代码使用协议遵循本仓库的开源协议及附加协议
// Gitee源代码仓库https://gitee.com/diego2098/ThingsGateway
// Github源代码仓库https://github.com/kimdiego2098/ThingsGateway
// 使用文档https://diego2098.gitee.io/thingsgateway-docs/
// QQ群605534569
//------------------------------------------------------------------------------
#endregion
using SqlSugar;
namespace ThingsGateway.Admin.Core;
/// <summary>
/// 主键id基类
/// </summary>
public abstract class PrimaryIdEntity
{
/// <summary>
/// 主键Id
/// </summary>
[SugarColumn(ColumnDescription = "Id", IsPrimaryKey = true)]
[IgnoreExcel]
public virtual long Id { get; set; }
}
/// <summary>
/// 主键实体基类
/// </summary>
public abstract class PrimaryKeyEntity : PrimaryIdEntity
{
/// <summary>
/// 拓展信息
/// </summary>
[SugarColumn(ColumnName = "ExtJson", ColumnDescription = "扩展信息", ColumnDataType = StaticConfig.CodeFirst_BigString, IsNullable = true)]
[IgnoreExcel]
public virtual string ExtJson { get; set; }
}
/// <summary>
/// 框架实体基类
/// </summary>
public abstract class BaseEntity : PrimaryKeyEntity
{
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true, IsNullable = true)]
[IgnoreExcel]
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
[SugarColumn(ColumnDescription = "创建人", IsOnlyIgnoreUpdate = true, IsNullable = true)]
[IgnoreExcel]
public virtual string CreateUser { get; set; }
/// <summary>
/// 创建者Id
/// </summary>
[SugarColumn(ColumnDescription = "创建者Id", IsOnlyIgnoreUpdate = true, IsNullable = true)]
[IgnoreExcel]
public virtual long CreateUserId { get; set; }
/// <summary>
/// 软删除
/// </summary>
[SugarColumn(ColumnDescription = "软删除", IsNullable = true)]
[IgnoreExcel]
public virtual bool IsDelete { get; set; } = false;
/// <summary>
/// 更新时间
/// </summary>
[SugarColumn(ColumnDescription = "更新时间", IsOnlyIgnoreInsert = true, IsNullable = true)]
[IgnoreExcel]
public virtual DateTime? UpdateTime { get; set; }
/// <summary>
/// 更新人
/// </summary>
[SugarColumn(ColumnDescription = "更新人", IsOnlyIgnoreInsert = true, IsNullable = true)]
[IgnoreExcel]
public virtual string UpdateUser { get; set; }
/// <summary>
/// 修改者Id
/// </summary>
[SugarColumn(ColumnDescription = "修改者Id", IsOnlyIgnoreInsert = true, IsNullable = true)]
[IgnoreExcel]
public virtual long? UpdateUserId { get; set; }
/// <summary>
/// 排序码
///</summary>
[SugarColumn(ColumnName = "SortCode", ColumnDescription = "排序码")]
[IgnoreExcel]
public virtual int SortCode { get; set; }
}