57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using System.Net;
|
|
using YLErp.Jobs.Configs;
|
|
using YLErp.Jobs.Imp;
|
|
|
|
namespace YLErp.Jobs
|
|
{
|
|
public class JobsModule
|
|
{
|
|
public static void PreInit(IServiceCollection services)
|
|
{
|
|
// Job Configs
|
|
services.AddSingleton<JobConfigs>();
|
|
services.AddSingleton<EodVARCalcJobConfig>();
|
|
services.AddSingleton<GuoYuanCalcVolJobConfig>();
|
|
services.AddSingleton<GuoYuanPriceSyncJobConfig>();
|
|
services.AddSingleton<JinshidaExchangeTradeSyncJobConfig>();
|
|
services.AddSingleton<AtMoneyOptionQuotesJobConfig>();
|
|
services.AddSingleton<TradeRiskCalcJobV2Config>();
|
|
|
|
|
|
// Quote Jobs
|
|
services.AddTransient<AtMoneyOptionQuotesJob>();
|
|
services.AddTransient<EodVARCalcJob>();
|
|
services.AddTransient<GeLinCalcPnLJob>();
|
|
services.AddTransient<GuoYuanCalcVolJob>();
|
|
services.AddTransient<GuoYuanPriceSyncJob>();
|
|
services.AddTransient<JinshidaExchangeTradeSyncJob>();
|
|
services.AddTransient<SystemDateJob>();
|
|
services.AddTransient<SystemDatePrintJob>();
|
|
services.AddTransient<SystemStartJob>();
|
|
services.AddTransient<SystemEndJob>();
|
|
services.AddTransient<TradeRiskCalcJobV2>();
|
|
|
|
// RealTimeCalcPosition Jobs
|
|
services.AddTransient<RealTimeCalcPositionJob>();
|
|
|
|
// http client
|
|
//services.AddHttpClient("")
|
|
// .ConfigurePrimaryHttpMessageHandler(messageHandler =>
|
|
// {
|
|
// var handler = new HttpClientHandler();
|
|
// if (handler.SupportsAutomaticDecompression)
|
|
// {
|
|
// handler.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
|
|
// }
|
|
// return handler;
|
|
// });
|
|
}
|
|
|
|
public static void Init(IServiceProvider serviceProvider)
|
|
{
|
|
JobConfigs.LoadConfigs(serviceProvider);
|
|
}
|
|
}
|
|
}
|