package com.bonus.common.entity.app.vo;

import lombok.Data;
import org.apache.ibatis.type.Alias;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @className:JdConfigVo
 * @author:cwchen
 * @date:2024-08-13-9:41
 * @version:1.0
 * @description:近电感应设备属性配置-vo
 */
@Data
public class JdConfigVo {

    /**设备ID*/
    @NotNull(message = "设备ID不能为空")
    private Long devId;

    @NotBlank(message = "设备编码不能为空")
    private String devCode;

    @NotEmpty(message = "配置属性不能为空")
    private List<ConfigItems> configItems;

    @Data
    public static class ConfigItems {
        /**线路属性*/
        private String configType;
        /**线路属性名称*/
        private String configTypeName;
        /**电压等级*/
        private String voltageLevel;
        /**电压等级名称*/
        private String voltageLevelName;
        /**距离*/
        @Pattern(regexp = "^(?:100(?:\\.0{1,2})?|[1-9][0-9]?(?:\\.\\d{1,2})?|1(?:\\.\\d{1,2})?)$", message = "距离为（1-100米）区间内,最多保留两位小数", groups = {Query.class})
        private String distance;

        public interface Query {
        }
    }
}
