using JiaZhiQuan.Common.Attributes;
using JiaZhiQuan.Common.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Reflection.Metadata.Ecma335;
using static JiaZhiQuan.Common.CreatorSpace;

namespace JiaZhiQuan.Common.Models.VO.CreatorCenter
{
    /// <summary>
    /// 创作者中心，空间显示详情
    /// </summary>
    public class CreatorCenterSpaceVO
    {
        /// <summary>
        /// 空间详情
        /// </summary>
        public List<SpaceDetails> SpaceDetails { get; set; }

        /// <summary>
        /// 用户信息
        /// </summary>
        public UserInfo UserInfo { get; set; }
    }

    public class SpaceDetails
    {
        /// <summary>
        /// SpaceID
        /// </summary>
        public int ID { get; set; }

        /// <summary>
        /// 空间名称
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 空间类型
        /// </summary>
        public CreatorSpaceType ContentType { get; set; }

        /// <summary>
        /// 空间类型描述
        /// </summary>
        public string ContentTypeDesc { get { return AttributeUtils.GetEnumDescription<CreatorSpaceTypeDescAttribute>(this.ContentType)?.Name; } }

        /// <summary>
        /// 活动卡片详情，当空间类型为 活动卡片 时，该字段有效
        /// </summary>
        public ActivityCardDetails ActivityCardDetails { get; set; }

        /// <summary>
        /// 活动内容详情，当空间类型为 活动内容 时，该字段有效
        /// </summary>
        public ActivityRegionDetails ActivityRegionContentDetails { get; set; }

        /// <summary>
        /// Banner图详情，当空间类型为 Banner 时，该字段有效
        /// </summary>
        public List<BannerDetails> BannerDetails { get; set; }

        /// <summary>
        /// 用户文章列表，当空间类型为 我的作品 时，该字段有效
        /// </summary>
        public List<UserPostDetails> UserPostDetails { get; set; }

        /// <summary>
        /// 近7天数据统计，当空间类型为 近7日数据总览 时，该字段有效
        /// </summary>
        public List<object> DataDetails { get; set; }
    }

    /// <summary>
    /// 活动卡片详情
    /// </summary>
    public class ActivityCardDetails
    {
        public int ID { get; set; }

        /// <summary>
        /// Code
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 文案
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 高亮关键词
        /// </summary>
        public string KeyWord { get; set; }

        /// <summary>
        /// 活动图片
        /// </summary>
        public string Banner { get; set; }

        /// <summary>
        /// 是否允许关闭
        /// </summary>
        public bool AllowClose { get; set; }

        /// <summary>
        /// 跳转路径
        /// </summary>
        public string LinkUrl { get; set; }

        /// <summary>
        /// 可见性
        /// 1：非创作者
        /// 2：创作者
        /// 3：所有人
        /// </summary>
        public int Visual { get; set; }
    }

    /// <summary>
    /// 活动专区详情
    /// </summary>
    public class ActivityRegionDetails
    {
        public int ID { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 每页显示数量
        /// </summary>
        public int Size { get; set; }

        /// <summary>
        /// 活动内容显示样式
        /// </summary>
        public ActivityRegionStyleType Style { get; set; }

        /// <summary>
        /// 活动内容显示样式描述
        /// </summary>
        public string StyleDesc { get { return this.Style.ToString(); } }

        /// <summary>
        /// 是否有Tab
        /// </summary>
        public bool HasTab { get; set; }

        /// <summary>
        /// Tabs详情
        /// </summary>
        public List<ActivityRegionDetails> Tabs { get; set; }

        /// <summary>
        /// 活动内容列表
        /// </summary>
        public List<ActivityRegionContentDetails> Contents { get; set; }
    }

    /// <summary>
    /// 活动专题内容
    /// </summary>
    public class ActivityRegionContentDetails
    {
        public int ID { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 副文案
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 活动图片
        /// </summary>
        public string Banner { get; set; }

        /// <summary>
        /// 活动热度
        /// </summary>
        public int Hot { get; set; }

        /// <summary>
        /// 活动标签
        /// </summary>
        public string Label { get; set; }

        /// <summary>
        /// 是否启用按钮
        /// </summary>
        public bool BtnEnabled { get; set; }

        /// <summary>
        /// 按钮名称
        /// </summary>
        public string BtnName { get; set; }

        /// <summary>
        /// 按钮的跳转路径
        /// </summary>
        [JsonProperty("btnLink")]
        public string BtnLinkUrl { get; set; }

        /// <summary>
        /// 是否启用内容跳转
        /// </summary>
        public bool ContentEnabled { get; set; }

        /// <summary>
        /// 内容的跳转路径
        /// </summary>
        [JsonProperty("contentLink")]
        public string ContentLinkUrl { get; set; }


    }

    /// <summary>
    /// Banner图
    /// </summary>
    public class BannerDetails
    {
        public int ID { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// Banner地址
        /// </summary>
        public string ImageUrl { get; set; }

        /// <summary>
        /// 跳转
        /// </summary>
        public string ActionLink { get; set; }

        /// <summary>
        /// 跳转类型
        /// </summary>
        public int ActionType { get; set; }

        /// <summary>
        /// 跳转子类型
        /// </summary>
        public int ActionSubType { get; set; }

        /// <summary>
        /// 跳转参数
        /// </summary>
        public string ActionData { get; set; }
    }

    /// <summary>
    /// 用户文章详情
    /// </summary>
    public class UserPostDetails
    {
        public string ID { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        public string Summary { get; set; }

        /// <summary>
        /// 是否包含缩略图
        /// </summary>
        public bool HasThumbnails { get; set; }

        /// <summary>
        /// 缩略图
        /// </summary>
        public string Thumbnails { get; set; }

        /// <summary>
        /// 图文还是视频
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public Post.PostState State { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateAt { get; set; }
    }

    /// <summary>
    /// 用户信息
    /// </summary>
    public class UserInfo
    {
        public string ID { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Alias { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string HeadImage { get; set; }

        /// <summary>
        /// 粉丝数
        /// </summary>
        public int FansCount { get; set; }

        /// <summary>
        /// 已加入天数
        /// </summary>
        public int JoinDays { get; set; }

        /// <summary>
        /// 提示信息
        /// </summary>
        public string Tips { get; set; }
    }
}
