namespace SafeCampus.Application.Services.Business.ClassRoomCallTaskService;

public class ClassRoomCallTaskDto
{
    /// <summary>
    /// ID
    /// </summary>
    public long Id { get; set; }
    /// <summary>
    /// 摄像头id
    /// </summary>
    public string CameraId { get; set; }
    /// <summary>
    /// 摄像头名称
    /// </summary>
    public string CameraName { get; set; }
    /// <summary>
    /// 摄像头所属分组名称
    /// </summary>
    public string CameraGroup { get; set; }
    /// <summary>
    /// 点名任务id
    /// </summary>
    public string TaskId { get; set; }
    /// <summary>
    /// 点名持续时间，单位为分钟，取值[1, 100]
    /// </summary>
    public int ContinueTime { get; set; }
    /// <summary>
    /// 人员底库id
    /// </summary>
    public string PersonSetId { get; set; }
    /// <summary>
    /// 匹配相似度阈值（如果没传，系统默认用0.5）
    /// </summary>
    public float Similarity { get; set; }
    /// <summary>
    /// 创建时间
    /// </summary>
    public  DateTime CreateTime { get; set; }
    /// <summary>
    /// 结束时间
    /// </summary>
    public DateTime EndTime { get; set; }
}
public class ClassRoomCallTaskDtoMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<ClassRoomCallTask, ClassRoomCallTaskDto>()
            //.Map(dest => dest.CameraName, src => src.CameraId.GetDescriptionByEnum<CameraType>());
            .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName)
            .Map(dest => dest.CameraGroup, src => src.CameraInfoItem.CameraGroupItem.Name);
    }
}