This commit is contained in:
老野兔子 2025-07-27 02:21:45 +08:00
parent 9fd956ae39
commit 0358ebca2a

View File

@ -11,27 +11,49 @@ namespace iyixiGames.Domain.Entities
/// </summary>
public class Game
{
/// <summary>
/// Unique identifier for the game.
/// </summary>
public string Id { get; set; } = Guid.NewGuid().ToString("N"); // Unique game identifier
/// <summary>
/// 游戏名称
/// </summary>
[Required]
[StringLength(100, MinimumLength = 3)]
public string Name { get; set; } = string.Empty; // Game name
/// <summary>
/// 游戏路径
/// </summary>
[Required]
[StringLength(1024, MinimumLength = 1)]
public string Path { get; set; } = string.Empty; // Game folder name, e.g., "space-adventure"
/// <summary>
/// 游戏描述
/// </summary>
// New: Game Description
[StringLength(1000)] // Adjust max length as needed
public string? Description { get; set; } // Short description generated by AI or manually entered
/// <summary>
/// 游戏类别
/// </summary>
public string Category { get; set; } = string.Empty;
// 应用自定义转换器
/// <summary>
/// 游戏流行度
/// </summary>
[JsonPropertyName("popularity")]
[JsonConverter(typeof(IntConverter))]
[Range(0, 100)]
public int Popularity { get; set; } = 0;
/// <summary>
/// 游戏平均
/// </summary>
[Range(0.0, 5.0)]
public double AvgRating { get; set; } = 0.0;