コード例 #1
0
 public ResponseMessageWrap <int> Update([FromBody] LogInfo logInfo)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = LogInfoService.Update(logInfo)
     });
 }
コード例 #2
0
 public ResponseMessageWrap <int> DeleteById(long id)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = LogInfoService.DeleteById(id)
     });
 }
コード例 #3
0
 public ResponseMessageWrap <int> Insert([FromBody] LogInfo logInfo)
 {
     return(new ResponseMessageWrap <int>
     {
         Body = LogInfoService.Insert(logInfo)
     });
 }
コード例 #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IBackgroundJobClient backgroundJobs,
                              IWebHostEnvironment env, IHttpService httpService,
                              IDateTimeService dateTimeService, ILoginService loginService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseHangfireDashboard();

            // Hangfire jobs
            PAKNService pAKNService = new PAKNService(Configuration, httpService, loginService, dateTimeService);

            RecurringJob.AddOrUpdate(() => pAKNService.Truncate(), "0 23 * * *", TimeZoneInfo.Local);
            RecurringJob.AddOrUpdate(() => pAKNService.CreateDanhSachDuLieu(), "0 0 * * *", TimeZoneInfo.Local);
            RecurringJob.AddOrUpdate(() => pAKNService.AddChiTieuBaoCao(), "10 0 * * *", TimeZoneInfo.Local);

            DVCService dVCService = new DVCService(Configuration, httpService, loginService, dateTimeService);

            RecurringJob.AddOrUpdate(() => dVCService.CreateDanhSachDuLieuByDay(), "40 0 * * *", TimeZoneInfo.Local);
            RecurringJob.AddOrUpdate(() => dVCService.AddChiTieuBaoCao(), "0 1 * * *", TimeZoneInfo.Local);

            CDDHService cDDHService = new CDDHService(Configuration, httpService, loginService, dateTimeService);

            RecurringJob.AddOrUpdate(() => cDDHService.Truncate(), "15 23 * * *", TimeZoneInfo.Local);
            RecurringJob.AddOrUpdate(() => cDDHService.CreateDanhSachDuLieu(), "5 0 * * *", TimeZoneInfo.Local);
            RecurringJob.AddOrUpdate(() => cDDHService.AddChiTieuBaoCao(), "20 0 * * *", TimeZoneInfo.Local);

            LogInfoService logInfoService = new LogInfoService(Configuration, httpService);

            RecurringJob.AddOrUpdate(() => logInfoService.AddChiTieuBaoCao(), "30 0 * * *", TimeZoneInfo.Local);

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapHangfireDashboard();
            });
        }
コード例 #5
0
        public override string Handle()
        {
            UserInfoService     UserBLL     = new UserInfoService();
            LogInfoService      LogBLL      = new LogInfoService();
            ProfilesInfoService ProfilesBLL = new ProfilesInfoService();

            if (Event == "subscribe")
            {
                string SubcribeContent = string.Empty;// ProfilesBLL.GetValue(ProfilesInfo.Wechat.SubcribeContent);
                if (string.IsNullOrEmpty(SubcribeContent))
                {
                    SubcribeContent = "欢迎关注!";
                }
                return(ResponseText(SubcribeContent));
            }
            else
            {
                return(string.Empty);
            }
        }
コード例 #6
0
 public LogInfoController(LogInfoService _logservice)
 {
     logservice = _logservice;
 }
コード例 #7
0
        private object GetSqlData()
        {
            SQLService.LogInfoService logService = new LogInfoService();

            //插入
            DateTime startTime = DateTime.Now;
            //for (int i = 0; i < 100000; i++)
            //{
            //    var entity = new SQLService.Log_Info();
            //    entity.AddTime = DateTime.Now;
            //    entity.adddate = DateTime.Now;
            //    entity.IsStar = false;
            //    entity.cityid = 0;
            //    entity.LogClassID = 1;
            //    entity.LogTypeId = 0;
            //    entity.LogIDOld = 0;
            //    entity.userid = i;
            //    entity.isdel = 0;
            //    entity.orgid = 22;
            //    entity.mapid = 884444;
            //    entity.LogMemo = "测试Log_Info插入";
            //    entity.isadmin = 0;
            //    entity.mapid2 = 884444;
            //    int dbSource = 5;
            //    entity.DBSource = dbSource;
            //    entity.AddFromMethod = "zhonghai.mongodbtest.testinsert";
            //    entity.LogID = logService.Add(entity);
            //}

            var entity = new SQLService.Log_Info();

            entity.AddTime    = DateTime.Now;
            entity.adddate    = DateTime.Now;
            entity.IsStar     = false;
            entity.cityid     = 0;
            entity.LogClassID = 1;
            entity.LogTypeId  = 0;
            entity.LogIDOld   = 0;
            entity.userid     = 0;
            entity.isdel      = 0;
            entity.orgid      = 22;
            entity.mapid      = 884444;
            entity.LogMemo    = "测试Log_Info插入";
            entity.isadmin    = 0;
            entity.mapid2     = 884444;
            int dbSource = 5;

            entity.DBSource      = dbSource;
            entity.AddFromMethod = "zhonghai.mongodbtest.testinsert";
            entity.LogID         = logService.Add(entity);

            DateTime endTime = DateTime.Now;

            //查询
            var count    = 0;// logService.GetRecordCount("1=1 and LogClassID=1");
            var difftime = (endTime - startTime).TotalMilliseconds;
            var result   = new
            {
                count,
                difftime
            };

            return(result);
        }
コード例 #8
0
 public LogInfoController(LogInfoService logInfoService, ILogInfoRepository logInfoRepository)
 {
     LogInfoService    = logInfoService;
     LogInfoRepository = logInfoRepository;
 }