using QYZH.InteractiveMagazine.Models.Enum;
using QYZH.InteractiveMagazine.Common.Extensions;
using QYZH.InteractiveMagazine.Common.Helpers;
using QYZH.InteractiveMagazine.Models.Enum;

namespace QYZH.InteractiveMagazine.Models.Dto.Journal
{
    public class JournalPageV2Output
    {


        public long JournalId { get; set; }

        public long JournalCatalogId { get; set; }

        public long JournalPageId { get; set; }

        public string Layout { get; set; }

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

        private string _url;
        /// <summary>
        /// 图片
        /// </summary>
        public string Url
        {
            get { return DomainHelper.OssFullUrl(_url); }
            set { _url = value; }
        }

        /// <summary>
        /// 问题
        /// </summary>
        public List<JournalPageTaskV2Output>? Tasks { get; set; }

        public List<JournalPageOtherOutput>? Areas { get; set; }
    }

    public class JournalPageTaskV2Output
    {
        public long Id { get; set; }
        public long GroupId {  get; set; }

        /// <summary>
        /// 题号
        /// </summary>
        public string No { get; set; }


        //public long test => long.Parse(No.Replace("-", string.Empty));

        /// <summary>
        /// 题型
        /// </summary>
        public TaskBankTypeEnum Type { get; set; }

        public string ShowType => Type.GetDescription();

        /// <summary>
        /// 答案列表
        /// </summary>
        public List<JournalTaskAnswerOutput> Answers { get; set; }

        /// <summary>
        /// 是否分配
        /// </summary>
        public bool Assign { get; set; }
    }

    public class JournalPageOtherOutput
    {
        public long Id { get; set; }

        /// <summary>
        /// 题号
        /// </summary>
        public string No { get; set; }

        /// <summary>
        /// 题型
        /// </summary>
        public TaskBankTypeEnum Type { get; set; }

        public string ShowType => Type.GetDescription();
    }
}
