using Dlhis.Entity.Basic.Entity; using Dlhis.Entity.Device.Entities; using Dlhis.Middle.Entities; using Dlhis.Middle.Services; using Dlhis.Middle.Services.Implements; using Kurisu.AspNetCore.Startup; using Microsoft.IdentityModel.Logging; namespace Dlhis.Middle; class Program { static void Main(string[] args) { KurisuHost.Run(args); } } public class Startup : DefaultStartup { public Startup(IConfiguration configuration) : base(configuration) { IdentityModelEventSource.ShowPII = true; } public override void ConfigureServices(IServiceCollection services) { base.ConfigureServices(services); services.AddHttpClient("face").ConfigurePrimaryHttpMessageHandler(() => { var handler = new HttpClientHandler { ClientCertificateOptions = ClientCertificateOption.Manual, ServerCertificateCustomValidationCallback = (_, _, _, _) => true }; return handler; }); services.AddHostedService(); services.AddMemoryCache(); } /// public override void Configure(IApplicationBuilder app, IWebHostEnvironment env) { base.Configure(app, env); using var scope = app.ApplicationServices.CreateScope(); var factory = Configuration.GetSection("Factory").Value; var ds = scope.ServiceProvider.GetService(); ds.TruncateAsync().Wait(); ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); // // ds.DownloadAsync(factory).Wait(); // ds.DownloadAsync(factory).Wait(); } }