| | |
| | | using System; |
| | | using IStation.Common; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | |
| | | using System.Web.Optimization; |
| | | using System.Web.Routing; |
| | | |
| | | namespace SPump.TransferApi |
| | | namespace IStation.WebApi |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class WebApiApplication : System.Web.HttpApplication |
| | | { |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | protected void Application_Start() |
| | | { |
| | | AreaRegistration.RegisterAllAreas(); |
| | | GlobalConfiguration.Configure(WebApiConfig.Register);//里面会设置跨域 |
| | | GlobalConfiguration.Configure(WebApiConfig.Register); |
| | | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); |
| | | RouteConfig.RegisterRoutes(RouteTable.Routes); |
| | | BundleConfig.RegisterBundles(BundleTable.Bundles); |
| | | |
| | | //IocConfig.Register(); |
| | | SPump.LogHelper.Initial(); |
| | | GlobalParas.Initial(); |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override void Init() |
| | | { |
| | | //添加了,才能用session |
| | | this.PostAuthenticateRequest += (sender, e) => HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required); |
| | | base.Init(); |
| | | } |
| | | //不考虑时差 |
| | | var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; |
| | | json.Indent = false; |
| | | json.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Local; |
| | | |
| | | DataFolderHelper.IsExeExcute = true;//独立运行 |
| | | |
| | | // IStation.LogHelper.Initial(); |
| | | |
| | | IStation.Common.AnaSetting.Initial(); |
| | | IStation.Common.ReservoirParasHelper.Initial(); |
| | | IStation.Common.RiverWaterLevelDropHelper.Initial(); |
| | | |
| | | //初始化雪花Id |
| | | //SnowflakeIdHelper.InitId(1); |
| | | |
| | | ScheduleTask.Initial(); |
| | | } |
| | | } |
| | | } |
| | | } |