package com.fuyuanshen.equipment.domain.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.converters.bytearray.ByteArrayImageConverter;
import lombok.Data;

/**
 * @author: 默苍璃
 * @date: 2025-06-0710:00
 */
@Data
@HeadRowHeight(20)  // 表头行高
@ContentRowHeight(100)  // 内容行高
public class DeviceExcelImportDTO {

    @ExcelProperty("设备类型")
    private Long deviceType;

    @ExcelProperty("客户号")
    private Long customerId;

    @ExcelProperty("设备名称")
    @ColumnWidth(20)
    private String deviceName;

    @ExcelProperty(value = "设备图片", converter = ByteArrayImageConverter.class)
    @ColumnWidth(15)
    private byte[] devicePic;

    // 添加图片写入方法
    public void setDevicePicFromBytes(byte[] bytes) {
        this.devicePic = bytes;
    }

    @ExcelProperty("设备MAC")
    @ColumnWidth(20)
    private String deviceMac;

    @ExcelProperty("设备IMEI")
    @ColumnWidth(20)
    private String deviceImei;

    @ExcelProperty("设备SN")
    @ColumnWidth(20)
    private String deviceSn;

    @ExcelProperty("经度")
    private String longitude;

    @ExcelProperty("纬度")
    private String latitude;

    @ExcelProperty("备注")
    @ColumnWidth(30)
    private String remark;

    @ExcelProperty("设备类型名称")
    private String typeName;

    @ExcelProperty("蓝牙名称")
    private String bluetoothName;

}