using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 图片
    /// </summary>
    [Table("Pictures")]
    public class Picture
    {
        /// <summary>
        /// 数据ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 图片类别
        /// </summary>
        public int Type { get; set; } = 0;

        /// <summary>
        /// 上传文件名
        /// </summary>
        [Column(TypeName = "varchar(50)")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 文件大小
        /// </summary>
        public int FileSize { get; set; } = 0;

        /// <summary>
        /// 文件存放位置
        /// </summary>
        [Column(TypeName = "varchar(250)")]
        public string Path { get; set; } = string.Empty;

        /// <summary>
        /// 文件访问域名
        /// </summary>
        [Column(TypeName = "varchar(250)")]
        public string Domain { get; set; } = string.Empty;

        /// <summary>
        /// 文件hash
        /// </summary>
        [Column(TypeName = "varchar(128)")]
        public string SHA256Hash { get; set; } = string.Empty;

        /// <summary>
        /// 数据创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime CreateTime { get; set; } = DateTime.UtcNow;

    }
}
