From 76eef0389848065963a295c66163a630697054fa Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期日, 07 七月 2024 09:47:01 +0800
Subject: [PATCH] PDA
---
代码管理/PCS/WCS_Server/WIDESEA_WebApi/Startup.cs | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Startup.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Startup.cs"
index 894bcf0..d792027 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Startup.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WebApi/Startup.cs"
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Autofac;
@@ -123,12 +124,12 @@
//鍒嗕负2浠芥帴鍙f枃妗�
c.SwaggerDoc("v1", new OpenApiInfo { Title = "WIDESEA_Core鍚庡彴Api", Version = "v1", Description = "杩欐槸瀵规枃妗g殑鎻忚堪銆傘��" });
c.SwaggerDoc("v2", new OpenApiInfo { Title = "WIDESEA_Core瀵瑰涓夋柟Api", Version = "v2", Description = "xxx鎺ュ彛鏂囨。" }); //鎺у埗鍣ㄩ噷浣跨敤[ApiExplorerSettings(GroupName = "v2")]
- //鍚敤涓枃娉ㄩ噴鍔熻兘
- // var basePath = PlatformServices.Default.Application.ApplicationBasePath;
- // var xmlPath = Path.Combine(basePath, "WIDESEA_WebApi.xml");
- // c.IncludeXmlComments(xmlPath, true);//鏄剧ず鎺у埗鍣▁ml娉ㄩ噴鍐呭
- //娣诲姞杩囨护鍣� 鍙嚜瀹氫箟娣诲姞瀵规帶鍒跺櫒鐨勬敞閲婃弿杩�
- //c.DocumentFilter<SwaggerDocTag>();
+ //鍚敤涓枃娉ㄩ噴鍔熻兘
+ // var basePath = PlatformServices.Default.Application.ApplicationBasePath;
+ // var xmlPath = Path.Combine(basePath, "WIDESEA_WebApi.xml");
+ // c.IncludeXmlComments(xmlPath, true);//鏄剧ず鎺у埗鍣▁ml娉ㄩ噴鍐呭
+ //娣诲姞杩囨护鍣� 鍙嚜瀹氫箟娣诲姞瀵规帶鍒跺櫒鐨勬敞閲婃弿杩�
+ //c.DocumentFilter<SwaggerDocTag>();
var security = new Dictionary<string, IEnumerable<string>> { { AppSetting.Secret.Issuer, new string[] { } } };
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme()
@@ -140,7 +141,13 @@
BearerFormat = "JWT",
Scheme = "Bearer"
});
-
+ #region 鍚敤涓枃娉ㄩ噴鍔熻兘
+ //WIDESEA_WebApi涓嬬殑PropertyGroup娣诲姞<GenerateDocumentationFile>true</GenerateDocumentationFile><!--鍚敤涓枃娉ㄩ噴鍔熻兘-->
+ //鍚敤涓枃娉ㄩ噴鍔熻兘
+ var xmlFilename = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
+ //IncludeXmlComments true 鏄剧ず鎺у埗鍣ㄦ敞閲�
+ c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename), true);
+ #endregion
c.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{
--
Gitblit v1.9.3