增加IsMock参数

This commit is contained in:
lindj 2024-01-22 15:49:23 +08:00
parent 7e3690a325
commit 7235400aee

View File

@ -445,7 +445,8 @@ async Task RunProgram()
host.Services.AddHostedService<MainHostedService>();
host.Services.AddHostedService<TaskMonitorService>();
host.Services.AddSingleton<IInputService,SimulationInputService>();
if(commandOptions.IsMock)host.Services.AddSingleton<IInputService,SimulationInputService>();
else host.Services.AddSingleton<IInputService, InputService>();
host.Services.AddSingleton<ITransformService, TransformService>();
host.Services.AddSingleton<IOutputService, OutputService>();
var redisOptions = host.Configuration.GetSection("RedisCacheOptions").Get<RedisCacheOptions>() ?? new RedisCacheOptions();