refactor: 重命名内置后台任务注入方法名称
This commit is contained in:
parent
40d3aa3e97
commit
bf51dca5d0
|
@ -63,7 +63,7 @@ namespace Bootstrap.Admin
|
||||||
services.AddBootstrapAdminAuthentication();
|
services.AddBootstrapAdminAuthentication();
|
||||||
services.AddSwagger();
|
services.AddSwagger();
|
||||||
services.AddButtonAuthorization(MenuHelper.RetrieveAllMenus);
|
services.AddButtonAuthorization(MenuHelper.RetrieveAllMenus);
|
||||||
services.AddDemoTask();
|
services.AddBootstrapAdminBackgroundTask();
|
||||||
services.AddHttpClient<GiteeHttpClient>();
|
services.AddHttpClient<GiteeHttpClient>();
|
||||||
services.AddAdminHealthChecks();
|
services.AddAdminHealthChecks();
|
||||||
services.AddMvc(options =>
|
services.AddMvc(options =>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Longbow.Tasks;
|
using Longbow.Tasks;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -16,17 +16,18 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
/// 添加示例后台任务
|
/// 添加示例后台任务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="services"></param>
|
/// <param name="services"></param>
|
||||||
public static IServiceCollection AddDemoTask(this IServiceCollection services)
|
public static IServiceCollection AddBootstrapAdminBackgroundTask(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddHostedService<TaskBackgroundServices>();
|
services.AddTaskServices();
|
||||||
return services.AddTaskServices();
|
services.AddHostedService<BootstrapAdminBackgroundServices>();
|
||||||
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 后台任务服务类
|
/// 后台任务服务类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class TaskBackgroundServices : BackgroundService
|
internal class BootstrapAdminBackgroundServices : BackgroundService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 运行任务
|
/// 运行任务
|
||||||
|
|
Loading…
Reference in New Issue