From 36f146461d053c1ef69c6cf3104cda05b565bedf Mon Sep 17 00:00:00 2001 From: zyf <1071160500@qq.com> Date: 星期六, 09 八月 2025 11:27:10 +0800 Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~sjz/YC --- MESApplication/Startup.cs | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/MESApplication/Startup.cs b/MESApplication/Startup.cs index f506f0e..50bfa25 100644 --- a/MESApplication/Startup.cs +++ b/MESApplication/Startup.cs @@ -1,4 +1,5 @@ -锘縰sing MES.Service.Dto.@base; +锘縰sing System.Reflection; +using MES.Service.Dto.@base; using MES.Service.util; using Microsoft.OpenApi.Models; using Newtonsoft.Json; @@ -35,6 +36,10 @@ c.SwaggerDoc("v1", new OpenApiInfo { Title = "MESApplication.Api", Version = "v1" }); + var xmlFile = + $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; + var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); + c.IncludeXmlComments(xmlPath, true); }); //閰嶇疆JSON.NET @@ -66,6 +71,18 @@ "OPTIONS") ); }); + + #region 鎺ュ彛琛屽姩杩囨护鍣� + + services.AddControllers(options => + { + options.Filters.Add(new ActionFilter()); + }); + var serviceProvider = services.BuildServiceProvider(); + ActionFilter.LoggerError = + serviceProvider.GetRequiredService<ILogger<ActionFilter>>(); + + #endregion } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -92,5 +109,9 @@ app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + + ////////////////////////// + + /////////////////////////// } } \ No newline at end of file -- Gitblit v1.9.3