| | |
| | | using Swashbuckle.AspNetCore.SwaggerGen; |
| | | using Microsoft.OpenApi.Models; |
| | | using WIDESEA_StorageTaskServices; |
| | | using WIDESEA_ISquareCabinServices; |
| | | using WIDESEA_SquareCabinServices; |
| | | |
| | | var builder = WebApplication.CreateBuilder(args); |
| | | |
| | |
| | | { |
| | | builder.RegisterModule(new AutofacModuleRegister());//å¸¦ææ¥å£å±çæå¡æ³¨å
¥ |
| | | builder.RegisterModule<AutofacPropertityModuleReg>();// |
| | | // å¨ Autofac 䏿³¨å宿¶ä»»å¡æå¡ |
| | | //builder.RegisterType<CabinOrderServices>().As<ICabinOrderServices>().InstancePerLifetimeScope(); |
| | | }).ConfigureAppConfiguration((hostingContext, config) => |
| | | { |
| | | hostingContext.Configuration.ConfigureApplication(); |
| | |
| | | builder.Services.AddAllOptionRegister();//读åé
ç½®æä»¶ |
| | | builder.Services.AddMemoryCacheSetup();//ç¼å |
| | | builder.Services.AddSqlsugarSetup();//SqlSugar å¯å¨æå¡ |
| | | builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | //builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | |
| | | //todo åå§å模åéªè¯é
ç½® |
| | |
| | | |
| | | builder.Services.AddHttpContextSetup(); |
| | | |
| | | |
| | | builder.Services.AddTimedJob();//注å
¥æ¶é´job |
| | | //todo |
| | | builder.Services.AddMvc(options => |
| | | { |
| | |
| | | //app.UseSwaggerAuthorized(); |
| | | app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html")); |
| | | //}//夿æ¯å¦éè¦æå¼swagger |
| | | |
| | | app.UseIpLimitMiddle(); |
| | | app.UseApiLogMiddleware(); |
| | | //todo |
| | |
| | | app.UseCookiePolicy(); |
| | | app.UseStatusCodePages(); |
| | | |
| | | app.UseTimedJob();//ä½¿ç¨æ¶é´å®æ¶å¨ |
| | | app.UseRouting(); |
| | | |
| | | |