测试
This commit is contained in:
53
backend/HardwarePerformance.API/Models/ApiModels.cs
Normal file
53
backend/HardwarePerformance.API/Models/ApiModels.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace HardwarePerformance.API.Models
|
||||
{
|
||||
public class Category
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class Product
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Model { get; set; } = string.Empty;
|
||||
public string Manufacturer { get; set; } = string.Empty;
|
||||
public int CategoryId { get; set; }
|
||||
public int CurrentRank { get; set; }
|
||||
public DateTime ReleaseDate { get; set; }
|
||||
public decimal? Price { get; set; }
|
||||
}
|
||||
|
||||
public class ApiResponse<T>
|
||||
{
|
||||
[JsonPropertyName("success")]
|
||||
public bool Success { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("data")]
|
||||
public T? Data { get; set; }
|
||||
|
||||
[JsonPropertyName("message")]
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
|
||||
public class PagedResponse<T>
|
||||
{
|
||||
[JsonPropertyName("items")]
|
||||
public List<T> Items { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("totalCount")]
|
||||
public int TotalCount { get; set; }
|
||||
|
||||
[JsonPropertyName("pageNumber")]
|
||||
public int PageNumber { get; set; }
|
||||
|
||||
[JsonPropertyName("pageSize")]
|
||||
public int PageSize { get; set; }
|
||||
|
||||
[JsonPropertyName("totalPages")]
|
||||
public int TotalPages { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user