using System.ComponentModel.DataAnnotations;

namespace SHH.CameraSdk;

/// <summary>
/// 句柄绑定 DTO
/// 用于前端向后端传递窗口渲染句柄，实现视频流的硬件解码渲染
/// </summary>
public class BindHandleDto
{
    /// <summary>
    /// 窗口句柄 (IntPtr 转换为 long 类型传输，避免跨平台序列化问题)
    /// </summary>
    [Required(ErrorMessage = "渲染窗口句柄不能为空")]
    [Range(1, long.MaxValue, ErrorMessage = "句柄必须为有效的非负整数")]
    public long Handle { get; set; }

    /// <summary>
    /// 用途描述 (用于审计日志，如 "Main_Preview"、"AI_Analysis_Window")
    /// </summary>
    [MaxLength(64, ErrorMessage = "用途描述长度不能超过 64 个字符")]
    public string Purpose { get; set; } = string.Empty;
}