sunpengfei
2025-09-01 611af5472b33cbe81a1433ab29e26502a9aac795
FlexJobApi.Core/Utils/XmlDocUtils/XmlDocUtils.cs
@@ -24,6 +24,8 @@
    {
        private const string cacheKey = "XmlDoc";
        public static XmlDoc XmlDoc { get; set; }
        /// <summary>
        /// 生成注释文档
        /// </summary>
@@ -75,6 +77,8 @@
                }
            }
            XmlDoc = xmlDoc;
            if (xmlDoc.Members.Any())
            {
                var json = JsonConvert.SerializeObject(xmlDoc);
@@ -90,17 +94,19 @@
        /// <returns></returns>
        public static async Task<XmlDoc> GetXmlDocAsync()
        {
            XmlDoc xmlDoc = null;
            var json = await App.GetService<IDistributedCache>().GetStringAsync(cacheKey);
            if (!string.IsNullOrEmpty(json))
            if (XmlDoc == null)
            {
                xmlDoc = JsonConvert.DeserializeObject<XmlDoc>(json);
                var json = await App.GetService<IDistributedCache>().GetStringAsync(cacheKey);
                if (!string.IsNullOrEmpty(json))
                {
                    XmlDoc = JsonConvert.DeserializeObject<XmlDoc>(json);
                }
                if (XmlDoc == null)
                {
                    XmlDoc = await BuildXmlDocAsync();
                }
            }
            if (xmlDoc == null)
            {
                xmlDoc = await BuildXmlDocAsync();
            }
            return xmlDoc;
            return XmlDoc;
        }
        /// <summary>
@@ -113,15 +119,7 @@
        {
            if (xmlDoc == null)
            {
                var json = await App.GetService<IDistributedCache>().GetStringAsync(cacheKey);
                if (!string.IsNullOrEmpty(json))
                {
                    xmlDoc = JsonConvert.DeserializeObject<XmlDoc>(json);
                }
            }
            if (xmlDoc == null)
            {
                xmlDoc = await BuildXmlDocAsync();
                xmlDoc = await GetXmlDocAsync();
            }
            if (xmlDoc != null && memberInfo != null)
            {
@@ -131,6 +129,12 @@
            return null;
        }
        public static async Task<string> GetSummary(this MemberInfo memberInfo, XmlDoc xmlDoc = null)
        {
            var memberXmlDoc = await memberInfo.GetXmlDocMemberAsync(xmlDoc);
            return memberXmlDoc?.Summary;
        }
        private static string GetXmlDocMemberName(MemberInfo memberInfo)
        {
            if (memberInfo != null)