mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-29 07:27:36 +08:00
optimization request http
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Application.Services;
|
||||
using System.Application.Services.Implementation;
|
||||
using System.Application.UI;
|
||||
@@ -15,7 +16,12 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddDesktopLogging(this IServiceCollection services)
|
||||
{
|
||||
services.AddLogging(AppHelper.Configure);
|
||||
var (minLevel, cfg) = AppHelper.Configure();
|
||||
services.AddLogging(cfg);
|
||||
services.Configure<LoggerFilterOptions>(o =>
|
||||
{
|
||||
o.MinLevel = minLevel;
|
||||
});
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -41,18 +47,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加 通用 Http 服务
|
||||
/// </summary>
|
||||
/// <param name="services"></param>
|
||||
/// <returns></returns>
|
||||
public static IServiceCollection AddHttpService(this IServiceCollection services)
|
||||
{
|
||||
services.AddHttpClient(); // 添加 System.Net.Http.HttpClient / HttpClientFactory
|
||||
services.AddSingleton<IHttpService, HttpServiceImpl>();
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加 Steam 相关助手、工具类服务
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user