/// <summary> /// 获取登录日志 /// </summary> /// <param name="filters">过滤器</param> /// <returns></returns> public async Task <PagedResult <SmtpDto> > SearchSmtpsAsync(SmtpFilters filters) { var dbSet = _context.Smtps; var query = dbSet.AsQueryable(); if (filters.keywords.IsNotBlank()) { query = query.Where(item => item.FromUserName.Contains(filters.keywords) || item.FromUserMail.Contains(filters.keywords) || item.Host.Contains(filters.keywords)); } return(await query.OrderByDescending(item => item.CreateDateTime) .Select(item => new SmtpDto { Id = item.Id, Host = item.Host, Port = item.Port, FromUserMail = item.FromUserMail, FromUserName = item.FromUserName, PassWord = item.PassWord, UseDefaultCredentials = item.UseDefaultCredentials }).PagingAsync(filters.page, filters.rows)); }
/// <summary> /// 登录日志 /// </summary> /// <param name="filters"></param> /// <returns></returns> public async Task <IActionResult> SmtpList(SmtpFilters filters) { var result = await _SmtpService.SearchSmtpsAsync(filters); return(Json(result)); }