using QYZH.InteractiveMagazine.Models.Enum;

namespace QYZH.InteractiveMagazine.Models.Dto.Pet;

/// <summary>
/// 宠物模板创建/更新输入（包含进化链及图片）
/// </summary>
public class PetTemplateInput
{
    /// <summary>
    /// 模板名称
    /// </summary>
    public string Name { get; set; } = string.Empty;

    /// <summary>
    /// 模板描述
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    /// 模板图标地址
    /// </summary>
    public string? IconUrl { get; set; }

    /// <summary>
    /// 排序权重
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 模板类型: Normal, Special, Limited
    /// </summary>
    public string Type { get; set; } = PetTemplateTypeEnum.Normal.ToString();

    /// <summary>
    /// 进化链列表（创建时一并传入，每个阶段含一组图片）
    /// </summary>
    public List<PetEvolutionStageInput>? Evolutions { get; set; }
}

/// <summary>
/// 进化阶段输入（含该阶段的图片列表，用于模板创建时一并提交）
/// </summary>
public class PetEvolutionStageInput
{
    /// <summary>
    /// 阶段名称
    /// </summary>
    public string StageName { get; set; } = string.Empty;

    /// <summary>
    /// 阶段等级
    /// </summary>
    public int StageLevel { get; set; }

    /// <summary>
    /// 进化所需成长值
    /// </summary>
    public int RequiredGrowth { get; set; }

    /// <summary>
    /// 进化类型: Normal, Special
    /// </summary>
    public string Type { get; set; } = PetEvolutionTypeEnum.Normal.ToString();

    /// <summary>
    /// 该阶段对应的默认皮肤图片列表（其中 Type="Cover" 的为封面图）
    /// </summary>
    public List<PetStageImageInput>? Images { get; set; }
}

/// <summary>
/// 进化阶段图片输入（创建模板时使用）
/// </summary>
public class PetStageImageInput
{
    /// <summary>
    /// 图片地址
    /// </summary>
    public string ImageUrl { get; set; } = string.Empty;

    /// <summary>
    /// 图片顺序（动画帧序号）
    /// </summary>
    public int SortOrder { get; set; }

    /// <summary>
    /// 图片类型: Normal=普通帧, Cover=封面图
    /// </summary>
    public string Type { get; set; } = PetSkinImageTypeEnum.Normal.ToString();
}

/// <summary>
/// 宠物模板输出
/// </summary>
public class PetTemplateOutput
{
    public long Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public string? Description { get; set; }
    public long DefaultEvolutionId { get; set; }
    public string? IconUrl { get; set; }
    /// <summary>
    /// 封面图片地址（默认取初始阶段封面图）
    /// </summary>
    public string? CoverImageUrl { get; set; }
    public int SortOrder { get; set; }
    public string Type { get; set; } = string.Empty;
    public string Status { get; set; } = string.Empty;
    public string? CreatedBy { get; set; }
    public DateTime CreatedAt { get; set; }
    public string? UpdatedBy { get; set; }
    public DateTime? UpdatedAt { get; set; }
}

/// <summary>
/// 宠物模板分页查询输入
/// </summary>
public class PetTemplateQueryInput : PageQueryModel
{
    /// <summary>
    /// 模板名称（模糊搜索）
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 模板类型: Normal, Special, Limited
    /// </summary>
    public string? Type { get; set; }

    /// <summary>
    /// 状态: Active, Inactive
    /// </summary>
    public string? Status { get; set; }
}
