using System.Runtime.Serialization;
using Agebull.MicroZero.ZeroApis;
using Newtonsoft.Json;

namespace Agebull.Common.AppManage
{
    public static class EnumHelper
    {
        /// <summary>
        ///     Ó¦ÓÃ¹éÀàÀàÐÍÃû³Æ×ª»»
        /// </summary>
        public static string ToCaption(this ClassifyType value)
        {
            switch (value)
            {
                case ClassifyType.None:
                    return "ÎÞÈ¨ÏÞ";
                case ClassifyType.Hospital:
                    return "Ò½Ôº";
                case ClassifyType.App:
                    return "AppÓ¦ÓÃ";
                default:
                    return "Ó¦ÓÃ¹éÀàÀàÐÍ(´íÎó)";
            }
        }
    }

    /// <summary>
    /// Ó¦ÓÃ¹éÀàÀàÐÍ
    /// </summary>
    /// <remark>
    /// Ó¦ÓÃ¹éÀàÀàÐÍ
    /// </remark>
    public enum ClassifyType
    {
        /// <summary>
        /// ÎÞÈ¨ÏÞ
        /// </summary>
        None = 0x0,
        /// <summary>
        /// Ò½Ôº
        /// </summary>
        Hospital = 0x1,
        /// <summary>
        /// AppÓ¦ÓÃ
        /// </summary>
        App = 0x2,
    }
    /// <summary>
    /// Ò³ÃæÅäÖÃ
    /// </summary>
    [DataContract]
    [JsonObject(MemberSerialization.OptIn)]
    public class PageConfig : MicroZero.ZeroApis.IApiArgument
    {
        /// <summary>
        /// Ò³ÃæID
        /// </summary>
        [JsonProperty("pid", NullValueHandling = NullValueHandling.Ignore)]
        public long PageId { get; set; }

        /// <summary>
        /// ÏµÍ³ÄÚ²¿µÄÀàÃû
        /// </summary>
        [JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
        public string SystemType { get; set; }
        /// <summary>
        /// ÊÇ·ñÏÔÊ¾
        /// </summary>
        [JsonProperty("hide", NullValueHandling = NullValueHandling.Ignore)]
        public bool Hide { get; set; }
        /// <summary>
        /// ÊÇ·ñÉóÅú¶ÔÏó
        /// </summary>
        [JsonProperty("audit", NullValueHandling = NullValueHandling.Ignore)]
        public bool Audit { get; set; }

        /// <summary>
        /// ÄÜ·ñÖð¼¶ÉóÅú
        /// </summary>
        [JsonProperty("level_audit", NullValueHandling = NullValueHandling.Ignore)]
        public bool LevelAudit { get; set; }

        /// <summary>
        /// ÉóÅúÒ³Ãæ
        /// </summary>
        [JsonProperty("audit_page", NullValueHandling = NullValueHandling.Ignore)]
        public int AuditPage { get; set; }

        /// <summary>
        /// Ö÷Ò³Ãæ
        /// </summary>
        [JsonProperty("master_page", NullValueHandling = NullValueHandling.Ignore)]
        public int MasterPage { get; set; }

        /// <summary>
        /// ÊÇ·ñÊý¾Ý¹ÜÀí
        /// </summary>
        [JsonProperty("data_state", NullValueHandling = NullValueHandling.Ignore)]
        public bool DataState { get; set; }

        /// <summary>
        /// ±ê×¼±à¼­
        /// </summary>
        [JsonProperty("edit", NullValueHandling = NullValueHandling.Ignore)]
        public bool Edit { get; set; }

        bool MicroZero.ZeroApis.IApiArgument.Validate(out string message)
        {
            message = null;
            return true;
        }
    }
}