package com.usky.sas.service.vo;

import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 电子地图配置列表项，包含地图基础信息、背景图完整 URL、绑定设备及设备点位图标 URL、设备详情
 */
@Data
public class MapListItem {

    private String id;

    private String name;

    private Integer type;

    private String remark;

    private String parentId;

    private Double width;

    private Double height;

    private Boolean isMask;

    private String backImgId;

    /** 背景图完整访问 URL（protocol + host + port + pic.url/path） */
    private String backImgUrl;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    /**
     * 绑定在该地图上的设备列表（含点位图标 URL、设备详情及设备类型名称）
     */
    private List<MapDeviceItem> devices;

    @Data
    public static class MapDeviceItem {
        private String id;
        private String deviceId;
        private String mapId;
        private String imgId;
        private String deviceName;
        private Double x;
        private Double y;
        private Double width;
        private Double height;
        private Double angle;
        private String type;
        private String backgroundColor;
        private String fontColor;
        private String thickness;
        private Integer fontSize;
        private String text;
        /** 点位图标完整访问 URL */
        private String imgUrl;
        /** 绑定的设备详情（含设备类型名称） */
        private DeviceInfoVo deviceInfo;
    }

    @Data
    public static class DeviceInfoVo {
        private String id;
        private String deviceId;
        private Integer channel;
        /** 设备类型名称（如：视频安防监控） */
        private String deviceType;
        private String ipAddr;
        private Integer port;
        private String address;
        private String note;
    }
}

