using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JiShe.CollectBus.Common.Models
{
    /// <summary>
    /// 缓存全局分页结果
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class BusCacheGlobalPagedResult<T>
    {
        /// <summary>
        /// 数据集合
        /// </summary>
        public List<T> Items { get; set; }

        /// <summary>
        /// 总条数
        /// </summary>
        public long TotalCount { get; set; }

        /// <summary>
        /// 每页条数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int PageCount
        {
            get
            {
                return (int)Math.Ceiling((double)TotalCount / PageSize);
            }
        }

        /// <summary>
        /// 是否有下一页
        /// </summary>
        public bool HasNext { get; set; }

        /// <summary>
        /// 下一页的分页索引
        /// </summary>
        public decimal? NextScore { get; set; }

        /// <summary>
        /// 下一页的分页索引
        /// </summary>
        public string NextMember { get; set; }
    }
}
