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

import com.njcn.device.pq.pojo.po.PqsProtectvalue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author wr
 * @description
 * @date 2023/8/11 9:20
 */
@Data
public class ConstantValueParam implements Serializable {

    @ApiModelProperty(name = "hander", value = "用于匹配 0 定值 1 定值描述")
    @NotNull(message = "用于匹配 0 定值 1 定值描述不能为空")
    private Integer hander;

    @ApiModelProperty(name = "type", value = "区分内外定值")
    @NotNull(message = "区分内外定值不能为空")
    private Integer type;

    @ApiModelProperty(name = "json", value = "json数据")
    @NotNull(message = "json数据不能为空")
    private ConstantValue json;


    @Data
    public static class ConstantValue {
        private List<PqsProtectvalue> data;
        private String devindex;
        private Integer hander;
        private String lineindex;
        private String methodname;
    }

    @Data
    public static class Constant {

        @ApiModelProperty(name = "ip", value = "网络ip")
        private String ip;

        @ApiModelProperty(name = "type", value = "区分内外定值")
        private String type;

        @ApiModelProperty(name = "id", value = "监测编号或者终端编号")
        @NotBlank(message = "装置系列字典不能为空")
        private String id;

        @ApiModelProperty(name = "hander", value = "用于匹配 0 定值 1 定值描述")
        @NotBlank(message = "装置系列字典不能为空")
        private String hander;
    }

    @Data
    public static class ValueData extends Constant {

        @ApiModelProperty(name = "interValue", value = "数值")
        private String interValue;
    }

    @Data
    public static class Upgrades {

        @ApiModelProperty(name = "list", value = "终端id集合")
        @NotEmpty(message = "终端id集合不能为空")
        private List<String> list;

        @ApiModelProperty(name = "edIndex", value = "选中版本号id")
        @NotBlank(message = "选中版本号id不能为空")
        private String edIndex;

    }
}
