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

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 用户资料
    /// </summary>
    [Table("UserMetas")]
    public class UserMeta
    {
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 归属用户ID
        /// </summary>
        public long UserId { get; set; }

        /// <summary>
        /// 字段KEY
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string MetaKey { get; set; } = string.Empty;

        /// <summary>
        /// 存储值
        /// </summary>
        [Column(TypeName = "text")]
        public string MetaValue { 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; }
    }
}
