| | |
| | | using System; |
| | | using FlexJobApi.Core; |
| | | using Furion.DatabaseAccessor; |
| | | using MediatR; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | |
| | | namespace FlexJobApi.User.Application |
| | | { |
| | | public class GetRolesQueryHandler |
| | | /// <summary> |
| | | /// 查询角色分页列表 |
| | | /// </summary> |
| | | /// <param name="rep"></param> |
| | | public class GetRolesQueryHandler( |
| | | IRepository<Role> rep |
| | | ) : IRequestHandler<GetRolesQuery, PagedListQueryResult<GetRolesQueryResultItem>> |
| | | { |
| | | private readonly IRepository<Role> rep = rep; |
| | | |
| | | /// <inheritdoc/> |
| | | public Task<PagedListQueryResult<GetRolesQueryResultItem>> Handle(GetRolesQuery request, CancellationToken cancellationToken) |
| | | { |
| | | var q = rep.AsQueryable().AsNoTracking(); |
| | | if (request.UserType.HasValue) |
| | | { |
| | | q = q.Where(it => it.UserType == request.UserType); |
| | | } |
| | | if (request.ClientType.HasValue) |
| | | { |
| | | q = q.Where(it => it.ClientType == request.ClientType); |
| | | } |
| | | throw new NotImplementedException(); |
| | | } |
| | | } |
| | | } |