using SqlSugar;
using Yitter.IdGenerator;

namespace QYZH.InteractiveMagazine.Models.Entity
{
    public class SqlSugarBaseEntity
    {

        /// <summary>
        /// Desc:主键
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, ColumnName = "Id")]
        public long Id { get; set; } = YitIdHelper.NextId();
        /// <summary>
        /// Desc:
        /// Default:1
        /// Nullable:False
        /// </summary>           
        [SugarColumn(ColumnName = "Status")]
        public int Status { get; set; }

        /// <summary>
        /// Desc:是否删除
        /// Default:b'0'
        /// Nullable:False
        /// </summary>           
        [SugarColumn(ColumnName = "IsDeleted")]
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// Desc:创建人
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(ColumnName = "CreatedBy", IsOnlyIgnoreUpdate = true)]
        public string CreatedBy { get; set; }

        /// <summary>
        /// Desc:创建时间
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(ColumnName = "CreatedAt", IsOnlyIgnoreUpdate = true)]
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// Desc:修改人
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "UpdatedBy")]
        public string UpdatedBy { get; set; }

        /// <summary>
        /// Desc:修改时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "UpdatedAt")]
        public DateTime? UpdatedAt { get; set; }
    }
}
