using System;
using System.Linq;
using System.Text.Json.Serialization;

namespace QYZH.InteractiveMagazine.Models.Dto.Journal
{

    public class JournalImportDto
    {
        /// <summary>
        /// 书Id
        /// </summary>
        public long JournalId { get; set; }

        /// <summary>
        /// pdf地址
        /// </summary>
        public string PdfUrl { get; set; }

        /// <summary>
        /// 从多少页开始
        /// </summary>
        public int Index { get; set; }

        public List<JournalCatalogAddInput> JournalCatalogs { get; set; }
    }

    /// <summary>
    /// 目录导入
    /// </summary>
    public class JournalCatalogImportDto
    {
        /// <summary>
        /// 一级目录
        /// </summary>
        public string ParentName { get; set; }

        /// <summary>
        /// 二级目录
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 页码
        /// </summary>
        public int PageNum { get; set; }

        [JsonIgnore]
        public long PagePageId { get; set; }
    }

    public class JournalCatalogAddInput
    {
        /// <summary>
        /// 目录名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 级别
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 类型0-目录 1-页
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// url
        /// </summary>
        public string Url { get; set; }
    }

    public class JournalCatalogInput
    {
        /// <summary>
        /// 书Id
        /// </summary>
        public long JournalId { get; set; }

        /// <summary>
        /// 目录名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 父Id;无限级别
        /// </summary>
        public long ParentId { get; set; }

        /// <summary>
        /// 等级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 指定插入位置的索引（从0开始）不传或传null时默认追加到末尾
        /// </summary>
        public int? Position { get; set; }

        /// <summary>
        /// 类型0-目录 1-页
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// url
        /// </summary>
        public string Url { get; set; }
    }
}
