using FlexJobApi.Core; using MediatR; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FlexJobApi.User.Application { /// /// 企业查询处理器 /// public class EnterprisesQueryHandler : IRequestHandler> { /// /// 查询企业信息分页列表数据 /// /// /// /// public Task> Handle(GetEnterprisesQuery request, CancellationToken cancellationToken) { return request.PageModel.GetPagedListAsync( q => { if (request.Keywords.IsNotNull()) { q = q.Where(it => it.EnterpriseAuth.EnterpriseName.Contains(request.Keywords) || it.EnterpriseAuth.LegalPerson.Contains(request.Keywords) || it.Contacts.Contains(request.Keywords)); } if (request.IsConfigured.HasValue) { q = q.Where(it => (it.IsCheckedBankCard && it.RealAccess.HasValue && it.SmsAccess.HasValue) == request.IsConfigured); } return q; }, cancellationToken: cancellationToken); } } }