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

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 用户数据
    /// </summary>
    [Table("Users")]
    public class User
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 邮箱
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Email { get; set; } = string.Empty;

        /// <summary>
        /// 手机号
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Mobile { get; set; } = string.Empty;

        /// <summary>
        /// 头像
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Avatar { get; set; } = string.Empty;

        /// <summary>
        /// 登录密码
        /// </summary>  
        [Column(TypeName = "varchar(32)")]
        public string Password { get; set; } = string.Empty;

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

        /// <summary>
        /// 数据最后更新时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime? UpdateTime { get; set; }
    }
}
