mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 18:22:24 +08:00
style: 统一文件编码为 UTF-8
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -17,21 +17,21 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Sample
|
||||
{
|
||||
services.AddControllers();
|
||||
|
||||
// ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD> `appsettings.json` <EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 注入配置项(内容见 `appsettings.json` 文件)
|
||||
services.AddOptions();
|
||||
services.Configure<Options.WechatOptions>(Configuration.GetSection(nameof(Options.WechatOptions)));
|
||||
|
||||
// ע<EFBFBD><EFBFBD><EFBFBD>ֲ<EFBFBD>ʽ<EFBFBD><EFBFBD>
|
||||
// 注入分布式锁
|
||||
services.AddSingleton<Services.DistributedLock.IDistributedLockFactory, Services.DistributedLock.Implements.DistributedLockFactory>();
|
||||
|
||||
// ע<EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 注入仓储类
|
||||
services.AddSingleton<Services.Repositories.IWechatAccessTokenEntityRepository, Services.Repositories.Implements.WechatAccessTokenEntityRepository>();
|
||||
|
||||
// ע<EFBFBD>빤<EFBFBD><EFBFBD> HTTP <EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD>
|
||||
// 注入工厂 HTTP 客户端
|
||||
services.AddHttpClient();
|
||||
services.AddSingleton<Services.HttpClients.IWechatApiHttpClientFactory, Services.HttpClients.Implements.WechatApiHttpClientFactory>();
|
||||
|
||||
// ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// 注入后台任务
|
||||
services.AddHostedService<Services.BackgroundServices.WechatAccessTokenRefreshingBackgroundService>();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user