using Ant.Core.WebApi.Enum; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ant.Core.WebApi.Model { public class PagedApiResult: ApiResult> { public PagedApiResult(ApiStatusCode code, string message = null) : base(code, message) { } /// /// 兼容使用skiplimit查询的方式,自动计算pageindex /// /// /// /// /// public PagedApiResult(List datas, int total, int skip, int limit) : base(datas) { this.Pager = new Pager { Total = total, PageSize = limit, PageIndex = limit == 0 ? 1 : (skip / limit) + 1 }; } /// /// 分页信息 /// public Pager Pager { set; get; } = new Pager(); } public class Pager { public int PageIndex { set; get; } public int PageSize { set; get; } public int Total { set; get; } } }