示例#1
0
        /// <summary>
        /// 分页列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <BasePageQueryOutput <LogDto> > GetPageList(QueryLogsInput input)
        {
            var list        = new List <LogDto>();
            var totalNumber = 0;
            var query       = await _dbContext.Queryable <Log>()
                              .WhereIF(input.Level.IsNotNullAndWhiteSpace(), o => o.Level == input.Level)
                              .Select(o => new LogDto
            {
                Id           = o.Id,
                Application  = o.Application,
                BusinessId   = o.BusinessId,
                BusinessType = o.BusinessType,
                Level        = o.Level,
                Message      = o.Message,
                TimeStamp    = o.TimeStamp
            })
                              .ToPageListAsync(input.Page, input.PageSize, totalNumber);

            list        = query.Key;
            totalNumber = query.Value;
            return(new BasePageQueryOutput <LogDto> {
                Page = input.Page, Rows = list, Total = totalNumber
            });
        }
示例#2
0
 public async Task <BasePageQueryOutput <LogDto> > QueryLogsAsync([FromQuery] QueryLogsInput input)
 {
     return(await _business.GetPageList(input));
 }