using Yitter.IdGenerator;

namespace Entity;

/// <summary>
/// 实体基类
/// </summary>
public abstract class BaseEntity
{
    /// <summary>
    /// 主键ID (雪花算法有序ID)
    /// </summary>
    [Column(IsPrimary = true)]
    public long Id { get; set; } = YitIdHelper.NextId();

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}
