22 lines
707 B
C#
22 lines
707 B
C#
namespace Indotalent.Shared.Models;
|
|
|
|
public class ApiResponse<T>
|
|
{
|
|
public bool IsSuccess { get; set; }
|
|
public int StatusCode { get; set; }
|
|
public string? Message { get; set; }
|
|
public T? Value { get; set; }
|
|
public PaginationMetadata? Pagination { get; set; }
|
|
public List<string>? Errors { get; set; }
|
|
public DateTime ServerTime { get; set; } = DateTime.UtcNow;
|
|
}
|
|
|
|
public class PaginationMetadata
|
|
{
|
|
public int Count { get; set; }
|
|
public int Top { get; set; }
|
|
public int Skip { get; set; }
|
|
public int TotalPages => (int)Math.Ceiling((double)Count / (Top == 0 ? 1 : Top));
|
|
public bool HasPrevious => Skip > 0;
|
|
public bool HasNext => (Skip + Top) < Count;
|
|
} |