namespace SafeCampus.Application.Services.Business.BuildingService;

public class BuildingInfoDto
{
    /// <summary>
    /// ID
    /// </summary>
    public long? Id { get; set; }
    /// <summary>
    /// 宿舍楼名称
    /// </summary>
    public string Name { get; set; }
    /// <summary>
    /// 男寝还是女寝
    /// </summary>
    public bool Gender { get; set; }
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }
    /// <summary>
    /// 进入摄像头id
    /// </summary>
    public string InsCameraId { get; set; }
    /// <summary>
    /// 摄像头名称
    /// </summary>
    public string InsCameraName { get; set;}
    /// <summary>
    /// 出去摄像头id
    /// </summary>
    public string OutCameraId { get; set; }
    /// <summary>
    /// 出去摄像头名称
    /// </summary>
    public string OutCameraName { get; set;}
}

public class BuildingInfoDtoMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<BuildingInfo, BuildingInfoDto>()
            .Map(x => x.InsCameraName, x => x.InsCameraInfoItem.SensorName)
            .Map(x => x.OutCameraName, x => x.OutCameraInfoItem.SensorName);
    }
}