using System; using System.Collections.Generic; using System.Text; namespace Nirvana.Common { public class PageData { /// /// 当前页码 /// public int CurrentPage { get; set; } /// /// 总数 /// public int TotalNum { get; set; } /// /// 实体对象 /// public List Items { get; set; } /// /// 总页数 /// public int TotalPageCount { get; set; } public Object Total { get; set; } } public class PageDataAPI { /// /// 页码 /// public int pagesize { get; set; } /// /// 总页数 /// public int totalpage { get; set; } /// /// 总数 /// public int totalnum { get; set; } /// /// 项 /// public List items { get; set; } } /// /// 分页查询返回值 /// /// public class PageParms { /// /// 当前页码 /// public int page { get; set; } /// /// 总数 /// public int totalnum { get; set; } /// /// 每页显示的数量 /// public int limit { get; set; } /// /// 实体对象 /// public List Items { get; set; } /// /// 总页数 /// public int totalpage { get { return this.totalnum == 0 ? 0 : Convert.ToInt32(Math.Ceiling(totalnum * 1.0 / limit)); } } } /// /// 分页查询 /// public class QueryParams { /// /// 排序方式,asc-正序,desc-倒序 /// public string order { get; set; } = "desc"; /// /// 排序字段 /// public string sort { get; set; } = "createtime"; /// /// 当前页 /// public int offset { get; set; } /// /// 每页显示的数量 /// public int limit { get; set; } /// /// 多条件查询参数 /// public List queryParam { get; set; } } /// /// 分页查询的参数 /// public class ParamQuery { /// /// 页数 /// public int page { get; set; } = 1; /// /// 每页显示的数量 /// public int pagesize { get; set; } = 10; /// /// 排序方式,asc-正序,desc-倒序 /// public string order { get; set; } = "desc"; /// /// 排序字段 /// public string sort { get; set; } = "createtime"; /// /// 关键字 /// public string keyword { get; set; } } /// /// 分页查询返回的值 /// /// public class ParamReturnData { /// /// 当前页码 /// public int page { get; set; } /// /// 总数 /// public int totalnum { get; set; } /// /// 每页显示的数量 /// public int pagesize { get; set; } /// /// 实体对象 /// public List items { get; set; } /// /// 总页数 /// public int totalpage { get { return this.totalnum == 0 ? 0 : Convert.ToInt32(Math.Ceiling(totalnum * 1.0 / pagesize)); } } } }