dengjunjie
2025-03-12 f43b7df8400f4fcffc9f19dca0888d61e2b33d5f
ÏîÄ¿´úÂë/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/SwaggerSetup.cs
@@ -1,4 +1,4 @@
using log4net;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using System;
@@ -18,9 +18,6 @@
    /// </summary>
    public static class SwaggerSetup
    {
        private static readonly ILog log =
        LogManager.GetLogger(typeof(SwaggerSetup));
        /// <summary>
        /// Swagger
        /// </summary>
@@ -30,7 +27,7 @@
        {
            if (services == null) throw new ArgumentNullException(nameof(services));
            var basePath = AppContext.BaseDirectory;
            var basePath = AppDomain.CurrentDomain.BaseDirectory;
            //var basePath2 = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath;
            var ApiName = AppSettings.app(new string[] { "ApiName" });
@@ -53,18 +50,19 @@
                c.UseInlineDefinitionsForEnums();
                try
                {
                    //这个就是刚刚配置的xml文件名
                    //var xmlPath = Path.Combine(basePath, "Blog.Core.xml");
                    var xmlPath = Path.Combine(basePath, "WIDESEA_WMSServer.xml");
                    //默认的第二个参数是false,这个是controller的注释,记得修改
                    //c.IncludeXmlComments(xmlPath, true);
                    c.IncludeXmlComments(xmlPath, true);
                    //这个就是Model层的xml文件名
                    //var xmlModelPath = Path.Combine(basePath, "Blog.Core.Model.xml");
                    //c.IncludeXmlComments(xmlModelPath);
                    var xmlModelPath = Path.Combine(basePath, "WIDESEA_Model.xml");
                    c.IncludeXmlComments(xmlModelPath);
                    var xmlDTOPath = Path.Combine(basePath, "WIDESEA_DTO.xml");
                    c.IncludeXmlComments(xmlDTOPath);
                }
                catch (Exception ex)
                {
                    log.Error("Blog.Core.xml和Blog.Core.Model.xml ä¸¢å¤±ï¼Œè¯·æ£€æŸ¥å¹¶æ‹·è´ã€‚\n" + ex.Message);
                    //log.Error("Blog.Core.xml和Blog.Core.Model.xml ä¸¢å¤±ï¼Œè¯·æ£€æŸ¥å¹¶æ‹·è´ã€‚\n" + ex.Message);
                }
                // å¼€å¯åŠ æƒå°é”