hutongqing
2024-10-25 d85a4b97325020b7efe1a6cdbd55025c6408cec9
WIDESEAWCS_Server/WIDESEAWCS_Core/Extensions/SwaggerSetup.cs
@@ -30,7 +30,6 @@
            if (services == null) throw new ArgumentNullException(nameof(services));
            var basePath = AppContext.BaseDirectory;
            //var basePath2 = Microsoft.DotNet.PlatformAbstractions.ApplicationEnvironment.ApplicationBasePath;
            var ApiName = AppSettings.app(new string[] { "ApiName" });
            services.AddSwaggerGen(c =>
@@ -51,13 +50,13 @@
                try
                {
                    //这个就是刚刚配置的xml文件名
                    //var xmlPath = Path.Combine(basePath, "WIDESEAWCS_Server.xml");
                    var xmlPath = Path.Combine(basePath, "WIDESEAWCS_Server.xml");
                    //默认的第二个参数是false,这个是controller的注释,记得修改
                    //c.IncludeXmlComments(xmlPath, true);
                    c.IncludeXmlComments(xmlPath, true);
                    //这个就是Model层的xml文件名
                    //var xmlModelPath = Path.Combine(basePath, "WIDESEAWCS_Server.Model.xml");
                    //c.IncludeXmlComments(xmlModelPath);
                    var xmlModelPath = Path.Combine(basePath, "WIDESEAWCS_Server.Model.xml");
                    c.IncludeXmlComments(xmlModelPath);
                }
                catch (Exception ex)
                {