From 45771a2351de1a2abebd99d225cf4c12082d9358 Mon Sep 17 00:00:00 2001 From: H Vs Date: Thu, 29 Jun 2023 15:39:47 +0800 Subject: [PATCH] =?UTF-8?q?uft-8=20=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HealthMonitor.WebApi/Program.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/HealthMonitor.WebApi/Program.cs b/HealthMonitor.WebApi/Program.cs index 5fd2a29..34b0b58 100644 --- a/HealthMonitor.WebApi/Program.cs +++ b/HealthMonitor.WebApi/Program.cs @@ -1,4 +1,4 @@ -using AspectCore.Extensions.DependencyInjection; +锘縰sing AspectCore.Extensions.DependencyInjection; using HealthMonitor.Common; using HealthMonitor.Common.helper; using HealthMonitor.Core.Cache; @@ -39,7 +39,7 @@ namespace HealthMonitor.WebApi public static void Main(string[] args) { - //选择配置文件appsetting.json + //閫夋嫨閰嶇疆鏂囦欢appsetting.json var config = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) @@ -56,7 +56,7 @@ namespace HealthMonitor.WebApi builder.Services.AddHttpClient(Consts.DEFAULT_HTTPCLIENT_NAME, c => { - c.Timeout = TimeSpan.FromSeconds(10); //超时限制 + c.Timeout = TimeSpan.FromSeconds(10); //瓒呮椂闄愬埗 c.DefaultRequestHeaders.Add("Accept", "application/json"); //c.DefaultRequestHeaders.Connection.Add("keep-alive"); }); @@ -72,7 +72,7 @@ namespace HealthMonitor.WebApi builder.Services.AddSwaggerGen(); - #region scoped MySQL 数据库 + #region scoped MySQL 鏁版嵁搴 builder.Services // gps_card .AddDbContextPool((sp, options) => { @@ -161,7 +161,7 @@ namespace HealthMonitor.WebApi .AddSingleton(); //builder.Services.AddSingleton(); - //用AspectCore替换默认的IOC容器 + //鐢ˋspectCore鏇挎崲榛樿鐨処OC瀹瑰櫒 builder.Host.UseServiceProviderFactory(new DynamicProxyServiceProviderFactory()); #endregion @@ -203,8 +203,8 @@ namespace HealthMonitor.WebApi // Register the Swagger generator, defining 1 or more Swagger documents builder.Services.AddSwaggerGen(c => { - //c.SwaggerDoc(AppConsts.SWAGGER_DOC_GpsCard, new OpenApiInfo { Title = "GpsCard模块", Version = "v1", Description = "gps_card数据库服务" }); //分组显示 - c.SwaggerDoc(AppConsts.SWAGGER_DOC_HealthMonitor, new OpenApiInfo { Title = "HealthMonitor模块", Version = "v1", Description = "health_monitor数据库服务" }); //分组显示 + //c.SwaggerDoc(AppConsts.SWAGGER_DOC_GpsCard, new OpenApiInfo { Title = "GpsCard妯″潡", Version = "v1", Description = "gps_card鏁版嵁搴撴湇鍔" }); //鍒嗙粍鏄剧ず + c.SwaggerDoc(AppConsts.SWAGGER_DOC_HealthMonitor, new OpenApiInfo { Title = "HealthMonitor妯″潡", Version = "v1", Description = "health_monitor鏁版嵁搴撴湇鍔" }); //鍒嗙粍鏄剧ず c.DocumentFilter(); @@ -254,8 +254,8 @@ namespace HealthMonitor.WebApi app.UseSwaggerUI(c => { string sub = string.IsNullOrEmpty(prefix) ? "" : $"/{prefix}"; - //c.SwaggerEndpoint($"{sub}/{AppConsts.SWAGGER_DOC_GpsCard}/api-docs/", "GpsCard模块"); //分组显示 - c.SwaggerEndpoint($"{sub}/{AppConsts.SWAGGER_DOC_HealthMonitor}/api-docs/", "HealthMonitor模块"); //分组显示 + //c.SwaggerEndpoint($"{sub}/{AppConsts.SWAGGER_DOC_GpsCard}/api-docs/", "GpsCard妯″潡"); //鍒嗙粍鏄剧ず + c.SwaggerEndpoint($"{sub}/{AppConsts.SWAGGER_DOC_HealthMonitor}/api-docs/", "HealthMonitor妯″潡"); //鍒嗙粍鏄剧ず c.RoutePrefix = string.Empty; });