fix
This commit is contained in:
@@ -8,7 +8,9 @@ using Serilog;
|
||||
using Service.AppSettingModel;
|
||||
using WebApi;
|
||||
using WebApi.Middleware;
|
||||
using WebApi.Filters;
|
||||
using Yitter.IdGenerator;
|
||||
using Application.Extensions;
|
||||
|
||||
// 初始化雪花算法ID生成器
|
||||
var options = new IdGeneratorOptions(1); // WorkerId 为 1,可根据实际部署情况调整
|
||||
@@ -30,6 +32,7 @@ builder.Services.AddControllers(mvcOptions =>
|
||||
.Build();
|
||||
|
||||
mvcOptions.Filters.Add(new AuthorizeFilter(policy));
|
||||
mvcOptions.Filters.Add<GlobalExceptionFilter>(); // 添加全局异常过滤器
|
||||
});
|
||||
builder.Services.AddOpenApi();
|
||||
builder.Services.AddHttpClient();
|
||||
@@ -124,6 +127,9 @@ builder.Services.AddSingleton(fsql);
|
||||
// 自动扫描注册服务和仓储
|
||||
builder.Services.AddServices();
|
||||
|
||||
// 注册Application层服务
|
||||
builder.Services.AddApplicationServices();
|
||||
|
||||
// 配置 Quartz.NET 定时任务
|
||||
builder.AddScheduler();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user