From cbba9b897a865fbf253a03cd818a1044637e8334 Mon Sep 17 00:00:00 2001 From: kazelee <1847801760@qq.com> Date: 星期五, 30 五月 2025 17:25:50 +0800 Subject: [PATCH] 修复git云端文件夹大小写不一致的问题:完成 --- App_Start/SwaggerConfig.cs | 47 ++++------------------------------------------- 1 files changed, 4 insertions(+), 43 deletions(-) diff --git a/App_Start/SwaggerConfig.cs b/App_Start/SwaggerConfig.cs index 7d069fe..557097d 100644 --- a/App_Start/SwaggerConfig.cs +++ b/App_Start/SwaggerConfig.cs @@ -1,49 +1,14 @@ using System.Web.Http; using WebActivatorEx; -using HH.WCS.Mobox3.DSZSH; +using HH.WCS.Mobox3.Template; using Swashbuckle.Application; -using System.IO; -using System.Reflection; -using System; -using Swashbuckle.Examples; [assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")] -namespace HH.WCS.Mobox3.DSZSH +namespace HH.WCS.Mobox3.Template { public class SwaggerConfig { - public static void Register(HttpConfiguration config) { - var thisAssembly = typeof(SwaggerConfig).Assembly; - - config - .EnableSwagger(c => { - c.SingleApiVersion("v1", "HH.WCS.Mobox3.DSZSH"); - - // 璁剧疆 XML 娉ㄩ噴璺緞 - var baseDirectory = AppDomain.CurrentDomain.BaseDirectory; - //var commentsFileName = Assembly.GetExecutingAssembly().GetName().Name + ".xml"; - var commentsFileName = "bin\\Debug\\HH.WCS.Mobox3.DSZSH.xml"; - var commentsFile = Path.Combine(baseDirectory, commentsFileName); - - if (File.Exists(commentsFile)) { - c.IncludeXmlComments(commentsFile); - } - - // 鍏朵粬閰嶇疆... - c.UseFullTypeNameInSchemaIds(); - - // 鍚敤绀轰緥鏁版嵁 - //c.DescribeAllEnumsAsStrings(); - //c.OperationFilter<ExamplesOperationFilter>(); - //c.ModelFilter<ExamplesModelFilter>(); - - }) - .EnableSwaggerUi(c => { - // UI 閰嶇疆 - }); - } - public static void Register() { var thisAssembly = typeof(SwaggerConfig).Assembly; @@ -67,7 +32,7 @@ // hold additional metadata for an API. Version and title are required but you can also provide // additional fields by chaining methods off SingleApiVersion. // - c.SingleApiVersion("v1", "HH.WCS.Mobox3.DSZSH"); + c.SingleApiVersion("v1", "HH.WCS.Mobox3.Template"); // If you want the output Swagger docs to be indented properly, enable the "PrettyPrint" option. // @@ -96,7 +61,7 @@ //c.BasicAuth("basic") // .Description("Basic HTTP Authentication"); // - // NOTE: You must also configure 'EnableApiKeySupport' below in the SwaggerUI section + // NOTE: You must also configure 'EnableApiKeySupport' below in the SwaggerUI section //c.ApiKey("apiKey") // .Description("API Key Authentication") // .Name("apiKey") @@ -137,10 +102,6 @@ // more Xml comment files. // //c.IncludeXmlComments(GetXmlCommentsPath()); - - // 鍚敤 XML 娉ㄩ噴 - var xmlFile = $"{System.AppDomain.CurrentDomain.BaseDirectory}\\HH.WCS.Mobox3.DSZSH.xml"; - c.IncludeXmlComments(xmlFile); // Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types // exposed in your API. However, there may be occasions when more control of the output is needed. -- Gitblit v1.9.1