using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace TEAMModelOS.SDK.Models
{
    /// <summary>
    /// 话题
    /// </summary>
    public class Debate : CosmosEntity
    {
        ///id设计  uuid
        /// code 设计  Debate-hbcn
        /// <summary>
        /// 创建者的醍摩豆ID
        /// </summary>
        public string tmdid { get; set; }
        /// <summary>
        /// 创建者昵称
        /// </summary>
        public string tmdname { get; set; }
        /// <summary>
        /// 话题的标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 话题内容
        /// </summary>
        public string comment { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public long time { get; set; }
        /// <summary>
        /// 评论/话题的统一id,用于被关联
        /// </summary>
        public string comid { get; set; }
        /// <summary>
        /// 点赞数
        /// </summary>
        public int likeCount { get; set; }
        /// <summary>
        /// 学校编码
        /// </summary>
        public string school { get; set; }
        /// <summary>
        /// 回复记录
        /// </summary>
        public List<DebateReply> replies { get; set; } = new List<DebateReply>();
        /// <summary>
        /// 点赞记录
        /// </summary>
        public List<LikeRcd> likes { get; set; } = new List<LikeRcd>();
        /// <summary>
        /// 允许回复的字数
        /// </summary>
        public int wordCount { get; set; }
        /// <summary>
        /// 是否开启话题时间范围内再回复。 默认不开启，则到期时间戳 expire为0
        /// </summary>
        public bool timeoutReply { get; set; } = false;
        /// <summary>
        /// 到期时间///服务器需要返回当前时间。
        /// </summary>
        public long expire { get; set; } = 0;
        /// <summary>
        /// 话题创建的来源  默认的normal, classvideo，ability,uploadscore
        /// </summary>
        public string source { get; set; } = "normal";
        /// <summary>
        /// 0私密话题 1公开话题
        /// </summary>
        public int openType { get; set; } = 1;
        /// <summary>
        /// 话题标签
        /// </summary>
        public List<string> tags = new List<string>();
    }
    /// <summary>
    /// 当前话题下的所有评语的点赞记录
    /// </summary>
    public class LikeRcd { 
        /// <summary>
        /// 评论或者话题本身的id
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 点赞的tmdid
        /// </summary>
        public string tmdid { get; set; }
    }
    /// <summary>
    /// 话题回复
    /// </summary>
    public class DebateReply{
        public string id { get; set; }
        /// <summary>
        /// 话题的id
        /// </summary>
        public string pid { get; set; }
        /// <summary>
        /// 回复者的id
        /// </summary>
        public string tmdid { get; set; }
        /// <summary>
        /// 回复者的昵称
        /// </summary>
        public string tmdname { get; set; }
        /// <summary>
        /// 回复的评语
        /// </summary>
        public string comment { get; set; }
        /// <summary>
        /// 回复的时间
        /// </summary>
        public long time { get; set; }
        /// <summary>
        /// 点赞数
        /// </summary>
        public int likeCount { get; set; }
        public string atTmdid { get; set; }
        public string atTmdname { get; set; }
    }
}
