From 65d87e7e291195e55e01bd22154172ded0cb3e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Tue, 5 Mar 2024 11:43:38 +0800 Subject: [PATCH] =?UTF-8?q?swagger=20=E6=8A=98=E5=8F=A0=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds-wms-service/DS.WMS.AdminApi/Program.cs | 4 ++++ ds-wms-service/DS.WMS.MainApi/Logs/internal-nlog.txt | 7 +++++++ ds-wms-service/DS.WMS.MainApi/Program.cs | 3 +++ 3 files changed, 14 insertions(+) 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" });