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

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.web.constant.ValidMessage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;


/**
 * pqs
 * 变电站bo
 * @author cdf
 * @date 2021/7/1
 */
@Data
@ApiModel
public class SubStationParam {


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

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

    /**
     * （关联PQS_Dictionary表）电压等级Guid
     */
    @NotBlank(message = "电压等级不可为空")
    @ApiModelProperty(name ="scale",value = "电压等级",required = true)
    private String scale;

    /**
     * 变电站经度longitude
     * @author cdf
     * @date 2021/7/16
     */
    @ApiModelProperty(name ="longitude",value = "变电站经度")
    private BigDecimal lng;

    /**
     * 变电站纬度
     * @author cdf
     * @date 2021/7/16
     */
    @ApiModelProperty(name ="scale",value = "变电站纬度")
    private BigDecimal lat;


    /**
     * 更新操作实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class SubStationUpdateParam extends SubStationParam {

        /**
         * 表Id
         */
        @ApiModelProperty("subIndex")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String subIndex;
    }
}
