namespace SafeCampus.Application.Services.Business.PersonInfoService;

public class PersonInfoDto
{
    /// <summary>
    /// 人员id
    /// </summary>
    public string PersonId { get; set; }
    /// <summary>
    /// 人员名称
    /// </summary>
    public string Name { get; set; }
    /// <summary>
    /// 年龄
    /// </summary>
    public int Age { get; set; }
    /// <summary>
    /// 性别
    /// </summary>
    public string Gender { get; set; }
    /// <summary>
    /// 手机号
    /// </summary>
    public string Phone { get; set; }
    /// <summary>
    /// 扩展属性
    /// </summary>
    public string ExtData { get; set; }
    /// <summary>
    /// 人脸大小阈值
    /// </summary>
    public int FaceSizeLimit { get; set; }
    /// <summary>
    ///人脸质量分阈值
    /// </summary>
    public float QualityScore { get; set; }
    /// <summary>
    /// 班级id
    /// </summary>
    public string PersonSetId { get; set; }
    /// <summary>
    /// 班级名称
    /// </summary>
    public string PersonSetName { get; set; }
    /// <summary>
    /// 寝室名称
    /// </summary>
    public string DormitoryName { get; set; }
    /// <summary>
    /// 人脸列表
    /// </summary>
    public List<PersonFaces> Faces { get; set; }
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }
    /// <summary>
    /// 考勤列表
    /// </summary>
    public List<Attendance> Attendances { get; set; }
    /// <summary>
    /// 出勤状态
    /// </summary>
    public string State { get; set; }
    /// <summary>
    /// 进班时间
    /// </summary>
    public DateTime? InsTime { get; set; }

    public string DepName { get; set; }
    public string MajorName { get; set; }
}
public class PersonInfoDtoMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<PersonInfo, PersonInfoDto>()
            //.Map(dest => dest.CameraName, src => src.CameraId.GetDescriptionByEnum<CameraType>());
            .Map(dest => dest.PersonSetId, src => src.PersonSetId)
            .Map(dest => dest.PersonSetName, src => src.PersonSetInfoItem.PersonSetName)
            .Map(dest => dest.Faces, src => src.PersonFacesList)
            .Map(dest => dest.DormitoryName, src => src.DormitoryInfoItem.Name)
            .Map(dest => dest.DepName, src => src.PersonSetInfoItem.MajorInfoItem.DepartmentInfoItem.Name)
            .Map(dest => dest.MajorName, src => src.PersonSetInfoItem.MajorInfoItem.Name);
    }
}