✨ feat(新增): 注入后台服务
This commit is contained in:
parent
48099c21d1
commit
68d951b8f3
|
@ -20,6 +20,7 @@ public class BaseConfig
|
||||||
|
|
||||||
// 注入服务依赖
|
// 注入服务依赖
|
||||||
builder.AddApplicationServices();
|
builder.AddApplicationServices();
|
||||||
|
builder.AddApplicationBackendServices();
|
||||||
|
|
||||||
// 配置
|
// 配置
|
||||||
UseConfiguration(builder);
|
UseConfiguration(builder);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Bunny.Service.IService;
|
using Bunny.Service.BackgroundModule;
|
||||||
|
using Bunny.Service.IService;
|
||||||
using Bunny.Service.IService.Service;
|
using Bunny.Service.IService.Service;
|
||||||
using Bunny.WebApi.Controllers.Base;
|
using Bunny.WebApi.Controllers.Base;
|
||||||
|
|
||||||
|
@ -11,4 +12,14 @@ public static class ServiceRegistration
|
||||||
builder.Services.AddScoped<TemplateController>();
|
builder.Services.AddScoped<TemplateController>();
|
||||||
builder.Services.AddScoped<IBaseService, BaseService>();
|
builder.Services.AddScoped<IBaseService, BaseService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 注入后台服务相关
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="builder"></param>
|
||||||
|
public static void AddApplicationBackendServices(this WebApplicationBuilder builder)
|
||||||
|
{
|
||||||
|
// 测试注入后台服务
|
||||||
|
// builder.Services.AddHostedService<TemplateBackgroundModule>();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue