You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
959 B

using System;
using System.Collections.Generic;
using X1.Application.Features.Users.Queries.Dtos;
namespace X1.Application.Features.Users.Queries.GetAllUsers;
/// <summary>
/// 获取所有用户响应
/// 包含用户列表和分页信息
/// </summary>
/// <param name="Users">用户列表</param>
/// <param name="TotalCount">总记录数</param>
/// <param name="PageNumber">当前页码</param>
/// <param name="PageSize">每页记录数</param>
public sealed record GetAllUsersResponse(
List<UserSimpleDto> Users,
int TotalCount,
int PageNumber,
int PageSize)
{
/// <summary>
/// 总页数
/// </summary>
public int TotalPages => (int)Math.Ceiling(TotalCount / (double)PageSize);
/// <summary>
/// 是否有上一页
/// </summary>
public bool HasPreviousPage => PageNumber > 1;
/// <summary>
/// 是否有下一页
/// </summary>
public bool HasNextPage => PageNumber < TotalPages;
}