package com.njcn.energy.pojo.param;

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

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

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/3/8 13:52
 */
@Data
public class LineParam {

    @ApiModelProperty(value = "监测点id")
    @NotEmpty(message = "监测点id不可为空")
    private String lineId;

    @ApiModelProperty(value = "逻辑设备表Id")
    @NotEmpty(message = "逻辑设备表Id不可为空")
    private String pid;

    @ApiModelProperty(value = "监测点名称")
    @NotEmpty(message = "监测点名称不可为空")
    private String name;

    @ApiModelProperty(value = "监测点编号")
    @NotNull(message = "监测点编号不可为空")
    private Integer idx;

    @ApiModelProperty(value = "安装区域省")
    private String province;

    @ApiModelProperty(value = "安装区域市")
    private String city;

    @ApiModelProperty(value = "安装区域县或区")
    private String county;

    @ApiModelProperty(value = "安装地址（厂区或变电站）")
    private String address;

    @ApiModelProperty(value = "安装位置")
    private String position;

    @ApiModelProperty(value = "电压等级")
    private String volGrade;

    @ApiModelProperty(value = "PT变比")
    private String ptRatio;

    @ApiModelProperty(value = "CT变比")
    private String ctRatio;

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

        @ApiModelProperty("id")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String id;
    }

    /**
     * 分页查询实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class LineQueryParam extends BaseParam {


    }
}
