using IMCS.CCS.Services; using Microsoft.EntityFrameworkCore; using Quartz.Impl; using Quartz; using StackExchange.Redis; using System.ComponentModel.Design; using WCS.Common; using WCS.Repository; using WCS.Service; using WCS.Service.Impl; using WCS.Services; using Quartz.Spi; using GZY.Quartz.MUI.Extensions; using GZY.Quartz.MUI.BaseService; var builder = WebApplication.CreateBuilder(args); builder.Services.AddQuartzUI(); //添加本地调度任务访问 builder.Services.AddQuartzClassJobs(); // Add services to the container. // Redis var redisConfiguration = builder.Configuration.GetConnectionString("Redis"); builder.Services.AddSingleton(ConnectionMultiplexer.Connect(redisConfiguration)); var connectionString = builder.Configuration.GetConnectionString("MySqlConnection"); builder.Services.AddDbContext(options => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString))); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); // Repository builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); // Service builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); var app = builder.Build(); //Admin 123456 app.UseQuartzUIBasicAuthorized(); app.UseQuartz(); if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseSwagger(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Your API V1")); } app.UseStaticFiles(); app.UseDefaultFiles(); app.UseRouting(); app.MapControllers(); app.Run();