コード例 #1
0
        public async Task <MessageModel <ResponseEnum> > Get()
        {
            var data = new MessageModel <ResponseEnum>();

            var i = 0;
            var d = 3 / i;

            var blogArticles = await _blogArticleServices.GetBlogs();

            var roleModulePermissions = await _roleModulePermissionServices.QueryMuchTable();

            var roleModuleTask = _roleModulePermissionServices.Query();
            var listTask       = _advertisementServices.Query();

            var ad   = await roleModuleTask;
            var list = await listTask;


            _advertisementServices.ReturnExp();

            Love love = null;

            love.SayLoveU();

            return(data);
        }
コード例 #2
0
        public async Task <MessageModel <ResponseEnum> > Get()
        {
            var data = new MessageModel <ResponseEnum>();



            // 测试模拟异常,全局异常过滤器拦截
            var i = 0;
            var d = 3 / i;



            // 测试多表联查
            var roleModulePermissions = await _roleModulePermissionServices.QueryMuchTable();


            // 测试多个异步执行时间
            var roleModuleTask = _roleModulePermissionServices.Query();
            var listTask       = _advertisementServices.Query();
            var ad             = await roleModuleTask;
            var list           = await listTask;


            // 测试service层返回异常
            _advertisementServices.ReturnExp();

            Love love = null;

            love.SayLoveU();

            return(data);
        }
コード例 #3
0
        public async Task <MessageModel <ResponseEnum> > Get()
        {
            var data = new MessageModel <ResponseEnum>();

            /*
             *  测试 sql 查询
             */
            var queryBySql = await _blogArticleServices.QuerySql("SELECT bsubmitter,btitle,bcontent,bCreateTime FROM BlogArticle WHERE bID>5");

            /*
             *  测试按照指定列查询
             */
            var queryByColums = await _blogArticleServices
                                .Query <BlogViewModels>(it => new BlogViewModels()
            {
                btitle = it.btitle
            });

            /*
             *  测试 sql 更新
             *
             * 【SQL参数】:@bID:5
             *  @bsubmitter:laozhang619
             *  @IsDeleted:False
             * 【SQL语句】:UPDATE `BlogArticle`  SET
             *  `bsubmitter`=@bsubmitter,`IsDeleted`=@IsDeleted  WHERE `bID`=@bID
             */
            var updateSql = await _blogArticleServices.Update(new { bsubmitter = $"laozhang{DateTime.Now.Millisecond}", IsDeleted = false, bID = 5 });


            // 测试模拟异常,全局异常过滤器拦截
            var i = 0;
            var d = 3 / i;


            // 测试 AOP 缓存
            var blogArticles = await _blogArticleServices.GetBlogs();


            // 测试多表联查
            var roleModulePermissions = await _roleModulePermissionServices.QueryMuchTable();


            // 测试多个异步执行时间
            var roleModuleTask = _roleModulePermissionServices.Query();
            var listTask       = _advertisementServices.Query();
            var ad             = await roleModuleTask;
            var list           = await listTask;


            // 测试service层返回异常
            _advertisementServices.ReturnExp();

            return(data);
        }
コード例 #4
0
        public async Task <MessageModel <ResponseEnum> > Get()
        {
            var data = new MessageModel <ResponseEnum>();

            await _redisBasketRepository.ListLeftPushAsync(RedisMqKey.Loging, "xxxxxxxxxxxxxxxxxxx");

            /*
             *  测试 sql 查询
             */
            var queryBySql = await _blogArticleServices.QuerySql("SELECT bsubmitter,btitle,bcontent,bCreateTime FROM BlogArticle WHERE bID>5");


            /*
             *  测试 sql 更新
             *
             * 【SQL参数】:@bID:5
             *  @bsubmitter:laozhang619
             *  @IsDeleted:False
             * 【SQL语句】:UPDATE `BlogArticle`  SET
             *  `bsubmitter`=@bsubmitter,`IsDeleted`=@IsDeleted  WHERE `bID`=@bID
             */
            var updateSql = await _blogArticleServices.Update(new { bsubmitter = $"laozhang{DateTime.Now.Millisecond}", IsDeleted = false, bID = 5 });


            // 测试模拟异常,全局异常过滤器拦截
            var i = 0;
            var d = 3 / i;


            // 测试 AOP 缓存
            var blogArticles = await _blogArticleServices.GetBlogs();


            // 测试多表联查
            var roleModulePermissions = await _roleModulePermissionServices.QueryMuchTable();


            // 测试多个异步执行时间
            var roleModuleTask = _roleModulePermissionServices.Query();
            var listTask       = _advertisementServices.Query();
            var ad             = await roleModuleTask;
            var list           = await listTask;


            // 测试service层返回异常
            _advertisementServices.ReturnExp();

            Love love = null;

            love.SayLoveU();

            return(data);
        }
コード例 #5
0
ファイル: Job_Synchronous.cs プロジェクト: sunshine223/NET5
        private async Task Run(IJobExecutionContext context, int jobId)
        {
            var list = await roleModulePermissionServices.QueryMuchTable();

            if (jobId > 0)
            {
                var model = await tasksQzServices.QueryById(jobId);

                if (model != null)
                {
                    model.RunTimes += 1;
                    var separator = "<br>";
                    model.Remark =
                        $"【{DateTime.Now}】执行任务【Id:{context.JobDetail.Key.Name},组别:{context.JobDetail.Key.Group}】【执行成功】{separator}"
                        + string.Join(separator, StringHelper.GetTopDataBySeparator(model.Remark, separator, 9));
                    await tasksQzServices.Update(model);
                }
            }
            await Console.Out.WriteLineAsync("菜单总数量" + list.Count.ToString());
        }