package com.njcn.device.pq.pojo.param;

import com.njcn.common.pojo.constant.PatternRegex;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

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

/**
 * 母线信息表
 *
 * @author cdf
 * @since 2021-04-09
 */
@Data
@ApiModel
public class SubVoltageParam {

    @ApiModelProperty(name = "subvIndex",value = "母线索引")
    private String subvIndex;

    @ApiModelProperty(name = "name",value = "母线名称",required = true)
    @NotBlank(message = "母线名称不可为空")
    @Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "设备名称违规")
    private String name;

    @ApiModelProperty(name = "name",value = "原母线名称",required = true)
    private String oldName;

    /**
     * 母线号（在同一台设备中的电压通道号）
     */
    @NotNull(message = "母线号不可为空")
    @Range(min = 1,max = 6,message = "请选择母线号1-6")
    @ApiModelProperty(name = "num",value = "母线号",required = true)
    private Integer num;

    @ApiModelProperty(name = "scale",value = "电压等级",required = true)
    @NotBlank(message = "母线电压等级")
    private String scale;

    /**
     * 母线模型（0：虚拟母线；1：实际母线）
     * 默认是实际母线
     */
    @ApiModelProperty(name = "model",value = "母线模型",required = true)
    @NotNull(message = "母线模型不可为空")
    private Integer model;

    @ApiModelProperty(name = "sort",value = "排序",required = true)
    @NotNull(message = "排序不可为空")
    @Min(value = 0,message = "排序格式有误")
    private Integer sort;

    @ApiModelProperty(name = "lineParam",value = "监测点集合")
    @Valid
    private List<LineParam> lineParam;


    /**
     * 修改标识
     */
    @ApiModelProperty(name = "updateFlag",value = "修改标识")
    private Integer updateFlag;

}
