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

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 评论
    /// </summary>
    [Table("Comments")]
    public class Comment
    {
        /// <summary>
        /// 分类ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 归属站点应用ID
        /// </summary>
        public long SiteId { get; set; }

        /// <summary>
        /// 发布评论用户ID
        /// </summary>
        public long UserId { get; set; }

        /// <summary>
        /// 内容ID
        /// </summary>
        public long PostId { get; set; }

        /// <summary>
        /// 上级评论ID,0表示根评论
        /// </summary>
        public long ParentId { get; set; }

        /// <summary>
        /// 引用评论ID,0表示不引用
        /// </summary>
        public long QuoteId { get; set; }

        /// <summary>
        /// 评论信息
        /// </summary>
        [Column(TypeName = "text")]
        public string Content { get; set; } = string.Empty;

        /// <summary>
        /// 支持的点赞数
        /// </summary>
        public int LikeCount { get; set; }

        /// <summary>
        /// 回复的评论数
        /// </summary>
        public int Replies { get; set; }

        /// <summary>
        /// 评论IP
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Ip { get ; set; } = string.Empty;

        /// <summary>
        /// 评论状态,0-待审核,1-已发布,2-垃圾评论,3-回收站
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]

        public DateTime CreateTime { get; set; }

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