Files
DocprintService/src/YhCore.Common/Utils/PageInfo.cs
T
2026-09-02 10:23:24 +08:00

43 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace YhCore.Common.Utils
{
/// <summary>
/// 分页元信息(对应 Java 版 model.tool.PageInfo)。
/// C# 属性为 PascalCase,ASP.NET Core 默认 camelCase 序列化后
/// JSON 字段与 Java 版一致(pageNum/pageSize/total/totalPages/hasNext/hasPrev)。
/// </summary>
public class PageInfo
{
/// <summary>当前页码(从 0 开始,与 Spring Pageable 一致)</summary>
public int PageNum { get; set; }
/// <summary>每页大小</summary>
public int PageSize { get; set; }
/// <summary>总记录数</summary>
public int Total { get; set; }
/// <summary>总页数</summary>
public int TotalPages { get; set; }
/// <summary>是否有下一页</summary>
public bool HasNext { get; set; }
/// <summary>是否有上一页</summary>
public bool HasPrev { get; set; }
public PageInfo()
{
}
public PageInfo(int pageNum, int pageSize, int total, int totalPages, bool hasNext, bool hasPrev)
{
PageNum = pageNum;
PageSize = pageSize;
Total = total;
TotalPages = totalPages;
HasNext = hasNext;
HasPrev = hasPrev;
}
}
}