namespace SafeCampus.Application.Services.Business.Warn.Dto;

public class WarnInfoList
{
    public long ID { get; set; }
    /// <summary>
    /// 预警id
    /// </summary>
    public string AlarmId { get; set; }
    /// <summary>
    /// 预警类型
    /// </summary>
    public string AlarmType { get; set; }
    /// <summary>
    /// 预警类型名称
    /// </summary>
    public string AlarmTypeDesc { 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>
    /// 事件发生时间
    /// </summary>
    public DateTime Tick { get; set; }
    /// <summary>
    /// 摄像头快照，原链接有效期为2小时，获取到数据后下载到本地
    /// </summary>
    public string SnapshotUrl { get; set; }
    /// <summary>
    /// 人员id
    /// </summary>
    public string PersonId { get; set; }
    /// <summary>
    /// 人员名称
    /// </summary>
    public string PersonName { get; set; }
    /// <summary>
    /// 班级id
    /// </summary>
    public string PersonSetId { get; set; }
    /// <summary>
    /// 班级名称
    /// </summary>
    public string PersonSetName { get; set; }
    /// <summary>
    /// 专业名称
    /// </summary>
    public long MajorName { get; set; }
    /// <summary>
    /// 院系名称
    /// </summary>
    public long DepName { get; set; }
    /// <summary>
    /// 性别
    /// </summary>
    public string Gender { get; set; }
    /// <summary>
    /// 人员类型
    /// </summary>
    public string PersonType { get; set; }
    /// <summary>
    /// 预警处理状态
    /// </summary>
    public int WarnHand { get; set; }
    /// <summary>
    /// 处理时间
    /// </summary>
    public DateTime? HandTime { get; set; }
}
public class WarnInfoListMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<WarnInfo, WarnInfoList>()
            //.Map(dest => dest.CameraName, src => src.CameraId.GetDescriptionByEnum<CameraType>());
            .Map(dest => dest.CameraName, src => src.CameraInfoItem.SensorName)
            .Map(x=>x.PersonName,x=>x.PersonInfoItem.Name)
            .Map(x=>x.PersonSetName,x=>x.PersonSetInfoItem.PersonSetName)
            .Map(x=>x.MajorName,x=>x.PersonSetInfoItem.MajorInfoItem.Name)
            .Map(x=>x.DepName,x=>x.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name)
            .Map(dest => dest.CameraGroup, src => src.CameraInfoItem.CameraGroupItem.Name);
    }
}
