emoticon_api/ARW.Model/PagerInfo.cs
2023-06-05 07:53:22 +08:00

53 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.

using System;
using System.Collections.Generic;
using System.Text;
namespace ARW.Model
{
public class PagerInfo
{
/// <summary>
/// 当前页码
/// </summary>
public int PageNum { get; set; }
public int PageSize { get; set; }
/// <summary>
/// 总记录数
/// </summary>
public int TotalNum { get; set; }
/// <summary>
/// 总页码
/// </summary>
/// <summary>
/// 总页数
/// </summary>
public int TotalPage
{
get
{
return TotalNum > 0 ? TotalNum % PageSize == 0 ? TotalNum / PageSize : TotalNum / PageSize + 1 : 0;
}
}
/// <summary>
/// 排序字段
/// </summary>
public string Sort { get; set; } = string.Empty;
/// <summary>
/// 排序类型,前端传入的是"ascending""descending"
/// </summary>
public string SortType { get; set; } = string.Empty;
public PagerInfo()
{
PageNum = 1;
PageSize = 10;
}
public PagerInfo(int page = 1, int pageSize = 10)
{
PageNum = page;
PageSize = pageSize;
}
}
}