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:30
 */
@Data
public class DevCfgParam {

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

    @ApiModelProperty(value = "设备Id")
    @NotEmpty(message = "设备Id不可为空")
    private String did;

    @ApiModelProperty(value = "版本信息表Id")
    private String versionId;

    @ApiModelProperty(value = "设备数据模板Id")
    private String idx;

    @ApiModelProperty(value = "设备名称")
    private String name;

    @ApiModelProperty(value = "设备型号")
    private String type;

    @ApiModelProperty(value = "设备类别")
    private String devApp;

    @ApiModelProperty(value = "设备和联网装置通讯协议")
    private String protocol;

    /**
     * 设备和联网装置通讯接口 Lora、RS485、Eth、Bus内部总线方式
     */
    @ApiModelProperty(value = "设备和联网装置通讯接口")
    private String ci;

    /**
     * 内部时钟源 Rtc、None
     */
    @ApiModelProperty(value = "内部时钟源")
    private String iclk;

    /**
     * 外部时钟源 BCode、Sntp、MasterStation
     */
    @ApiModelProperty(value = "内部时钟源")
    private String eclk;

    /**
     * 数据上送周期（单位秒）
     */
    @ApiModelProperty(value = "数据上送周期")
    private Integer period;

    @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 Integer allNum;

    @ApiModelProperty(value = "监测点数目")
    private Integer lineNum;

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

        @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 DevCfgQueryParam extends BaseParam {


    }
}
