package com.njcn.gather.device.pojo.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.gather.pojo.constant.DetectionValidMessage;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author caozehui
 * @data 2025-07-01
 */
@Data
public class PqStandardDevExcel {

    @Excel(name = "名称*", width = 20, orderNum = "1")
    @NotBlank(message = DetectionValidMessage.NAME_NOT_BLANK)
    private String name;

    @Excel(name = "设备类型*", width = 25, orderNum = "2")
    @NotBlank(message = DetectionValidMessage.DEV_TYPE_NOT_BLANK)
    private String devType;

    @Excel(name = "设备厂家*", width = 25, orderNum = "3")
    @NotBlank(message = DetectionValidMessage.MANUFACTURER_NOT_BLANK)
    private String manufacturer;

    @Excel(name = "可检通道*", width = 25, orderNum = "4")
    @NotBlank(message = DetectionValidMessage.INSPECT_CHANNEL_NOT_BLANK)
    private String inspectChannel;

    @Excel(name = "通信协议*", width = 25, orderNum = "5")
    @NotBlank(message = DetectionValidMessage.PROTOCOL_NOT_BLANK)
    private String protocol;

    @Excel(name = "IP地址*", width = 25, orderNum = "6")
    @NotBlank(message = DetectionValidMessage.IP_NOT_BLANK)
    @Pattern(regexp = PatternRegex.IP_REGEX, message = DetectionValidMessage.IP_FORMAT_ERROR)
    private String ip;

    @Excel(name = "端口号*", width = 15, orderNum = "7")
    @NotNull(message = DetectionValidMessage.PORT_NOT_NULL)
    @Range(min = 1, max = 65535, message = DetectionValidMessage.PORT_RANGE_ERROR)
    private Integer port;

    @Excel(name = "是否加密*", width = 20, replace = {"否_0", "是_1"}, orderNum = "8")
    @NotNull(message = DetectionValidMessage.ENCRYPTION_NOT_NULL)
    private Integer encryptionFlag;

    @Excel(name = "识别码（当加密时必填）", width = 30, orderNum = "9")
    private String series;

    @Excel(name = "秘钥（当加密时必填）", width = 30, orderNum = "10")
    private String devKey;
}
