/// <summary> /// 读取分页数据 /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <ApiResult <Page <UserGroup> > > GetPagesAsync(GetUserGroupPagesRequest request) { return(await QueryResultAsync(async query => { var rsp = new ApiResult <Page <UserGroup> >(); var result = await query .HasWhere(request.Name, p => p.Name.Contains(request.Name)) .ToPageAsync(request.PageIndex, request.PageSize); if (result.Items.Count == 0) { rsp.Message = "暂无数据."; return rsp; } rsp.Message = "读取成功."; rsp.Data = result; rsp.Success = true; return rsp; })); }
public async Task <ApiResult <Page <UserGroup> > > GetPages([FromBody] GetUserGroupPagesRequest request) { return(await _userGroupService.GetPagesAsync(request)); }