Skip to content

Commit

Permalink
feat: little change
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoy8 committed Nov 25, 2023
1 parent 8188403 commit 325baf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
19 changes: 7 additions & 12 deletions Blog.Core.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@
builder.Services.AddMiniProfilerSetup();
builder.Services.AddSwaggerSetup();
builder.Services.AddJobSetup();

builder.Services.AddHttpContextSetup();
builder.Services.AddAppTableConfigSetup(builder.Environment);
builder.Services.AddHttpApi();
builder.Services.AddRedisInitMqSetup();
builder.Services.AddRabbitMQSetup();
builder.Services.AddKafkaSetup(builder.Configuration);
builder.Services.AddEventBusSetup();
builder.Services.AddNacosSetup(builder.Configuration);
builder.Services.AddInitializationHostServiceSetup();

builder.Services.AddAuthorizationSetup();
if (Permissions.IsUseIds4 || Permissions.IsUseAuthing)
{
Expand Down Expand Up @@ -114,15 +113,11 @@
options.SerializerSettings.Converters.Add(new StringEnumConverter());
//将long类型转为string
options.SerializerSettings.Converters.Add(new NumberConverter(NumberConverterShip.Int64));
})
//.AddFluentValidation(config =>
//{
// //程序集方式添加验证
// config.RegisterValidatorsFromAssemblyContaining(typeof(UserRegisterVoValidator));
// //是否与MvcValidation共存
// config.DisableDataAnnotationsValidation = true;
//})
;
});

builder.Services.AddRabbitMQSetup();
builder.Services.AddKafkaSetup(builder.Configuration);
builder.Services.AddEventBusSetup();

builder.Services.AddEndpointsApiExplorer();

Expand Down
7 changes: 0 additions & 7 deletions Blog.Core.Extensions/ServiceExtensions/JobSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using Microsoft.Extensions.DependencyInjection;
using Quartz;
using Quartz.Spi;
using System;
using System.Linq;
using System.Reflection;

namespace Blog.Core.Extensions
Expand All @@ -17,12 +15,7 @@ public static void AddJobSetup(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));

//services.AddHostedService<Job1TimedService>();
//services.AddHostedService<Job2TimedService>();

services.AddSingleton<IJobFactory, JobFactory>();
//services.AddTransient<Job_Blogs_Quartz>();//Job使用瞬时依赖注入
//services.AddTransient<Job_OperateLog_Quartz>();//Job使用瞬时依赖注入
services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>();
//任务注入
var baseType = typeof(IJob);
Expand Down

0 comments on commit 325baf8

Please sign in to comment.