using System;
using System.Collections.Generic;
using System.Text;
using GxPress.EnumConst;

namespace GxPress.Result
{
    /// <summary>
    /// 
    /// </summary>
    public class ContentJsonData
    {
        /// <summary>
        /// 作者 文章来源
        /// </summary>
        public string Author { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        public string TextType { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string File { get; set; }
        /// <summary>
        /// 文本类容
        /// </summary>
        public string Text { get; set; }
        /// <summary>
        /// 类型1 txt文字 2 img:图片 3 file:文件 4 Article:文章 5 notice通知 6 topic话题 7 note笔记 8 collection收藏 9站内信 10小组 11 会议ß 12 收藏文件夹 13 笔记文件夹 14 审批 400会议纪要
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <value></value>
        public int TypeValue { get => SetType((TextEditorTypeConst)Type); set => SetType((TextEditorTypeConst)Type); }
        /// <summary>
        ///  收藏笔记来源用户
        /// </summary>
        /// <value></value>
        public int SourceUserId { get; set; }
        /// <summary>
        /// 设置type  100 文章 1文本 2话题 3 收藏 4笔记 5通知 6站内信 7小组  12 收藏文件夹 13笔记文件夹 14工作流审批 300 文件 301图片 400会议纪要 500会议详情 601 财务报表 602人事报表 603 出版报表 21话题笔记
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public int SetType(TextEditorTypeConst type)
        {
            if (type == TextEditorTypeConst.Image)
                return OldTextEditorTypeConst.Image.GetHashCode();
            if (type == TextEditorTypeConst.File)
                return OldTextEditorTypeConst.File.GetHashCode();
            if (type == TextEditorTypeConst.Article)
                return OldTextEditorTypeConst.Article.GetHashCode();
            if (type == TextEditorTypeConst.Topic)
                return OldTextEditorTypeConst.Topic.GetHashCode();
            if (type == TextEditorTypeConst.Collect)
                return OldTextEditorTypeConst.Collect.GetHashCode();
            if (type == TextEditorTypeConst.Note)
                return OldTextEditorTypeConst.Note.GetHashCode();
            if (type == TextEditorTypeConst.TopicNote)
                return OldTextEditorTypeConst.Note.GetHashCode();
            if (type == TextEditorTypeConst.Missive)
                return OldTextEditorTypeConst.Missive.GetHashCode();
            if (type == TextEditorTypeConst.Group)
                return OldTextEditorTypeConst.Group.GetHashCode();
            return type.GetHashCode();
        }
        /// <summary>
        /// 内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 文件名称
        /// </summary>
        public string FileName { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public DateTime? CreatedData { get; set; }

        /// <summary>
        /// 文章图片地址
        /// </summary>
        public List<string> ArticleImgUrl { get; set; }
        /// <summary>
        /// 阅读数量
        /// </summary>
        public int ReadCount { get; set; }
        /// <summary>
        /// 文件个数
        /// </summary>
        public int FileCount { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        /// <value></value>
        public string NickName { get; set; }
    }

    /// <summary>
    /// 收藏
    /// </summary>
    public class CollectionContentJsonData
    {
        /// <summary>
        /// 作者 文章来源
        /// </summary>
        public string Author { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        public string TextType { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string File { get; set; }
        /// <summary>
        /// 文本类容
        /// </summary>
        public string Text { get; set; }
        /// <summary>
        /// 类型1 txt文字 2 img:图片 3 file:文件 4 Article:文章 5 notice通知 6 topic话题 7 note笔记 8 collection收藏 9站内信 10小组 11 会议ß 12 收藏文件夹 13 笔记文件夹 14 审批 400会议纪要
        /// </summary>
        public int Type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        /// <value></value>
        public int TypeValue { get => SetType((TextEditorTypeConst)Type); set => SetType((TextEditorTypeConst)Type); }
        /// <summary>
        /// 设置type  100文章 1文本 2话题 3 收藏 4笔记 5通知 6站内信 7小组  12 收藏文件夹 13笔记文件夹 14工作流审批 300 文件 301图片 400会议纪要 500会议详情 601 财务报表 602人事报表 603 出版报表
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public int SetType(TextEditorTypeConst type)
        {
            if (type == TextEditorTypeConst.File)
                return OldTextEditorTypeConst.File.GetHashCode();
            if (type == TextEditorTypeConst.Image)
                return OldTextEditorTypeConst.Image.GetHashCode();
            if (type == TextEditorTypeConst.Article)
                return OldTextEditorTypeConst.Article.GetHashCode();
            if (type == TextEditorTypeConst.Topic)
                return OldTextEditorTypeConst.Topic.GetHashCode();
            if (type == TextEditorTypeConst.Collect)
                return OldTextEditorTypeConst.Collect.GetHashCode();
            if (type == TextEditorTypeConst.Note)
                return OldTextEditorTypeConst.Note.GetHashCode();
            if (type == TextEditorTypeConst.Missive)
                return OldTextEditorTypeConst.Missive.GetHashCode();
            if (type == TextEditorTypeConst.Group)
                return OldTextEditorTypeConst.Group.GetHashCode();
            return type.GetHashCode();
        }
        /// <summary>
        /// 
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 文件名称
        /// </summary>
        public string FileName { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime? CreatedData { get; set; }

        /// <summary>
        /// 文章图片地址
        /// </summary>
        public List<string> ArticleImgUrl { get; set; }
        /// <summary>
        /// 阅读数量
        /// </summary>
        public int ReadCount { get; set; }
        /// <summary>
        /// 文件个数
        /// </summary>
        public int FileCount { get; set; }
        /// <summary>
        /// 类型1 txt文字 2 img:图片 3 file:文件 4 Article:文章 5 notice通知 6 topic话题 7 note笔记 8 collection收藏 9站内信 10小组 11会议
        /// </summary>
        public CollectionContentJsonData Data { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string AvatarUrl { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        /// <value></value>
        public string NickName { get; set; }
        /// <summary>
        /// 通知 站内信 1 正常 2 匿名信
        /// </summary>
        /// <value></value>
        public int MissiveType { get; set; }
        /// <summary>
        /// 是否存在小组话题
        /// </summary>
        /// <value></value>
        public bool IsGroup { get; set; }
        /// <summary>
        /// 小组ID
        /// </summary>
        /// <value></value>
        public int GroupId { get; set; }
        /// <summary>
        /// 小组名称
        /// </summary>
        /// <value></value>
        public string GroupName { get; set; }
        /// <summary>
        /// 文件大小
        /// </summary>
        /// <value></value>
        public int FileSize { get; set; }
        /// <summary>
        /// 缩略图
        /// </summary>
        /// <value></value>
        public string MinFile { get; set; }
         /// <summary>
        ///  收藏笔记来源用户
        /// </summary>
        /// <value></value>
        public int SourceUserId { get; set; }
    }
}
