using System.ComponentModel.DataAnnotations;
namespace SHH.CameraSdk;
///
/// 视频流订阅配置请求对象
/// 用于定义第三方应用或内部模块对指定相机流的消费需求
///
public class SubscriptionDto
{
///
/// 订阅标识 (如 "AI_Process_01"、"Main_Display_02")
///
[Required(ErrorMessage = "进程标识 AppId 不能为空")]
[MaxLength(50, ErrorMessage = "AppId 长度不能超过 50 个字符")]
public string AppId { get; set; } = string.Empty;
///
/// 订阅业务类型。
/// 决定了后端流控引擎后续的资源分配(如是否开启录像机或渲染器)。
///
public SubscriptionType Type { get; set; }
///
/// 显示帧率需求 (单位: fps)
/// 不需要显示则设为 0,控制器会自动注销该类型需求
///
[Range(0, 30, ErrorMessage = "显示帧率需在 0-30 fps 范围内")]
public int DisplayFps { get; set; }
///
/// 备注信息。
/// 用于记录订阅的用途、申请人或关联业务系统。
///
public string Memo { get; set; }
= string.Empty;
///
/// 窗口句柄(HWND)。
/// 仅在 Type 为 HandleDisplay 时必填。格式通常为十六进制或十进制字符串。
///
public string Handle { get; set; }
= string.Empty;
///
/// 录像持续时长(分钟,范围 1-60)。
/// 仅在 Type 为 LocalRecord 时有效。
///
public int RecordDuration { get; set; }
///
/// 录像文件存放绝对路径。
/// 仅在 Type 为 LocalRecord 时有效,例如:C:\Recordings\Room01。
///
public string SavePath { get; set; }
= string.Empty;
///
/// 通讯方式协议。
/// 仅在 Type 为 NetworkTrans 或 WebPush 时有效,默认为 Network。
///
public TransportProtocol Protocol { get; set; }
///
/// 目标接收端 IP 地址。
/// 仅在 Type 为 NetworkTrans 或 WebPush 且 Protocol 为 Network 时必填。
///
public string TargetIp { get; set; }
= string.Empty;
///
/// 目标接收端端口号。
/// 仅在 Type 为 NetworkTrans 或 WebPush 时必填。
///
public int TargetPort { get; set; }
}