diff --git a/ds-wms-service/DS.WMS.AdminApi/Program.cs b/ds-wms-service/DS.WMS.AdminApi/Program.cs index b6fa69ac..f0159d6a 100644 --- a/ds-wms-service/DS.WMS.AdminApi/Program.cs +++ b/ds-wms-service/DS.WMS.AdminApi/Program.cs @@ -11,6 +11,8 @@ using DS.Module.Swagger; using DS.Module.UserModule; using DS.WMS.AdminApi; using NLog.Web; +using Swashbuckle.AspNetCore.SwaggerUI; + var builder = WebApplication.CreateBuilder(args); var environment = builder.Environment.EnvironmentName; @@ -52,6 +54,8 @@ app { c.SwaggerEndpoint("/" + documentName + "/swagger.json", AppSetting.app(new string[] { "SwaggerDoc", "ContactName" })); + c.DocExpansion(DocExpansion.None);//DocExpansion设置为None可折叠所有方法 + c.DefaultModelExpandDepth(-1);//-1 可不显示Models }); //跨域 var policyName =AppSetting.app(new string[] { "Cors", "PolicyName" }); diff --git a/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt b/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt index 308ef263..837c6d58 100644 --- a/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt +++ b/ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt @@ -201,3 +201,10 @@ 2024-03-04 11:28:57.1737 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config 2024-03-04 11:28:57.2019 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-03-04 11:28:57.2487 Info Configuration initialized. +2024-03-05 11:42:42.5157 Info Registered target NLog.Targets.FileTarget(Name=allfile) +2024-03-05 11:42:42.5929 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web) +2024-03-05 11:42:42.6769 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console) +2024-03-05 11:42:42.7389 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False +2024-03-05 11:42:42.7983 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Code\DS\ds8-solution\ds-wms-service\DS.WMS.MainApi\bin\Debug\net8.0\nlog.config +2024-03-05 11:42:42.8190 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile +2024-03-05 11:42:42.8903 Info Configuration initialized. diff --git a/ds-wms-service/DS.WMS.MainApi/Program.cs b/ds-wms-service/DS.WMS.MainApi/Program.cs index 94123711..19ddf543 100644 --- a/ds-wms-service/DS.WMS.MainApi/Program.cs +++ b/ds-wms-service/DS.WMS.MainApi/Program.cs @@ -11,6 +11,7 @@ using DS.Module.Swagger; using DS.Module.UserModule; using DS.WMS.MainApi; using NLog.Web; +using Swashbuckle.AspNetCore.SwaggerUI; var builder = WebApplication.CreateBuilder(args); var environment = builder.Environment.EnvironmentName; @@ -58,6 +59,8 @@ app { c.SwaggerEndpoint("/" + documentName + "/swagger.json", AppSetting.app(new string[] { "SwaggerDoc", "ContactName" })); + c.DocExpansion(DocExpansion.None);//DocExpansion设置为None可折叠所有方法 + c.DefaultModelExpandDepth(-1);//-1 可不显示Models }); //跨域 var policyName =AppSetting.app(new string[] { "Cors", "PolicyName" });