Пример #1
0
        /// <summary>
        ///
        /// </summary>
        protected void Application_Start()
        {
            //webapi 配置
            GlobalConfiguration.Configure(WebApiConfig.Register);
            //RouteConfig.RegisterRoutes(RouteTable.Routes);
            //注册错误异常
            GlobalConfiguration.Configuration.Filters.Add(new ExceptionAttribute());
            //注册参数验证
            GlobalConfiguration.Configuration.Filters.Add(new ValidParameterAttribute());
            //注册认证
            //GlobalConfiguration.Configuration.Filters.Add(new AuthenticationAttribute());

            //上传文件服务
            //QueueHelper<UploadFileObj>.Register(UploadFileAction.UploadFile);
            //QueueHelper<UploadFileObj>.Start();

            QuartzHelper.CreateScheduler().GetAwaiter().GetResult();
            QuartzHelper.RegisterJob <SyncMessageJob>("/5 * * ? * *", "wechat").GetAwaiter().GetResult();
        }