/// <summary> /// 获取角色的信息 /// </summary> /// <returns></returns> public async Task <HeaderResult <List <RoleDto> > > GetRoleList(SearchRoleDto input) { Expression <Func <RoleInfo, bool> > where = e => true; if (!string.IsNullOrEmpty(input.SearchRoleName)) { where = where.And(e => e.RoleName.Contains(input.SearchRoleName)); } var roleList = await _roleRepository.LoadEntityListAsync(where, e => e.RoleName, "asc", input.PageIndex, input.Pagesize); var total = await _roleRepository.GetEntitiesCountAsync(where); var roleDtoList = roleList.MapToList <RoleInfo, RoleDto>(); HeaderResult <List <RoleDto> > result = new HeaderResult <List <RoleDto> > { IsSucceed = true, Result = roleDtoList, Total = total }; return(result); }
public async Task <HeaderResult <List <RoleDto> > > GetRoleList([FromBody] SearchRoleDto input) { return(await _userAppService.GetRoleList(input)); }