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