| | |
| | | |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.AspNetCore.Builder; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Server.Kestrel.Core; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.FileProviders; |
| | | using Microsoft.Extensions.Hosting; |
| | | using System.Text.Json.Serialization; |
| | | using Microsoft.Extensions.Hosting; |
| | | using System.Text.Json.Serialization; |
| | | using IGeekFan.AspNetCore.Knife4jUI; |
| | | using Furion; |
| | | using Furion.SpecificationDocument; |
| | |
| | | namespace IStation.ChEr.WebApi |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | [AppStartup(10)] |
| | | public class Startup : AppStartup |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | public void ConfigureServices(IServiceCollection services) |
| | | { |
| | | // services.AddConfigurableOptions<JWT.JWTSettingsOptions>(); |
| | | // services.AddConfigurableOptions<JWT.JWTSettingsOptions>(); |
| | | |
| | | services.Configure<KestrelServerOptions>(options => |
| | | { |
| | |
| | | c.UseInlineDefinitionsForEnums(); |
| | | }).AddMiniProfiler(); |
| | | |
| | | |
| | | services.AddJsonOptions(options => |
| | | { |
| | | //返回属性大小写问题 |
| | |
| | | |
| | | // SnowFlakeSingle.WorkId = 2;// Settings.SqlSugarParasHelper.SqlSugar.SnowFlakeWorkId; |
| | | |
| | | |
| | | |
| | | IStation.LogHelper.Info("log4net initial OK"); |
| | | |
| | | |
| | | //定时任务 |
| | | services.AddQuartz(q => |
| | |
| | | q.AddTrigger(opts => opts |
| | | .ForJob(jobKey) // link to the CalcWaterPredict |
| | | .WithIdentity("CalcWaterPredict-trigger") // give the trigger a unique name |
| | | .WithCronSchedule("0 06 0/1 * * ? ")); // 每小时一次,每次在该小时的06分开始执行: |
| | | |
| | | .WithCronSchedule("0 02 0/1 * * ? ")); // 每小时一次,每次在该小时的06分开始执行: |
| | | }); |
| | | |
| | | // Add the Quartz.NET hosted service |
| | | // Add the Quartz.NET hosted service |
| | | services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true); |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// |
| | | /// </summary> |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
| | | { |
| | |
| | | FileProvider = new PhysicalFileProvider(path)//指定实际物理路径 |
| | | }); |
| | | |
| | | #endregion |
| | | #endregion 开放 data 文件夹(可以通过url访问文件) |
| | | |
| | | // Serilog请求日志中间件---必须在 UseStaticFiles 和 UseRouting 之间 |
| | | //app.UseSerilogRequestLogging(); |
| | |
| | | name: "default", |
| | | pattern: "{controller=Home}/{action=Index}/{id?}"); |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |