package com.njcn.process.pojo.param;

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.util.List;

/**
 * <功能描述>
 *
 * @author wr
 * @createTime: 2023-03-10
 */
@Data
public class StrategyParam {

    @Data
    public static class StrategyPageParam extends StrategyParam {

        private String deptId;

        @ApiModelProperty(value = "页码")
        private Integer PageNum;

        @ApiModelProperty(value = "条数")
        private Integer PageSize;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("等级（0:自动策略 1:手动策略 2:排除策略）")
        private Integer grade;

        @ApiModelProperty(value = "区分预警单/告警单（0：预警单 ；1：告警单）")
        private Integer type;
    }

    @Data
    public static class StrategyInsertParam {

        @ApiModelProperty(value = "预警单id")
        private String id;

        @ApiModelProperty(value = "预警单名称")
        @NotBlank(message = "名称不能为空")
        private String name;

        @ApiModelProperty(value = "等级（0：一级；1：二级；2：三级）")
        @NotNull(message = "等级不能为空")
        private Integer grade;

        @ApiModelProperty(value = "0.通用策略  1.定值策略")
        @NotNull(message = "策略选择不能为空")
        private Integer bigType;

        @ApiModelProperty(value = "区分预警单还是告警单(0：预警单；1：告警单)")
        @NotNull(message = "区分类别不能为空")
        private Integer type;

    }

    @Data
    public static class BindParam {
        @ApiModelProperty(value = "部门id")
        @NotNull(message = "部门id不可为空")
        private String deptId;

        @ApiModelProperty(value = "策略id")
        private String id;

        @ApiModelProperty(value = "0.预警单 1.告警单")
        @NotNull(message = "策略类型不能为空")
        private Integer strategyType;

        @ApiModelProperty(value = "0：自动策略；1：手动策略；2：排他策略")
        @NotNull(message = "等级")
        private Integer grade;

        @ApiModelProperty(value = "策略名称")
        @NotNull(message = "策略名称不能为空")
        private String strategyName;




        @ApiModelProperty(value = "关系（0：与；1：或）只存在于指标类型中,三级策略不分与或")
        //@NotNull(message = "id不能为空")
        private Integer operation;

        @ApiModelProperty(value = "监测点标签")
        //@NotEmpty(message = "监测点标签集合不能为空")
        private List<String> monitorTag;

        @ApiModelProperty(value = "指标类型")
        @NotEmpty(message = "指标类型集合不能为空")
        private List<String> indicatorTypes;

        @ApiModelProperty(value = "监测点id集合")
        private List<String> monitorIds;
    }

    @Data
    public static class StrategyUpdateParam extends  StrategyUpParam{

        @ApiModelProperty(value = "关系（0：与；1：或）只存在于指标类型中")
        private Integer operation;

        @ApiModelProperty(value = "监测点标签")
        @NotEmpty(message = "监测点标签集合不能为空")
        private List<String> monitorTag;

        @ApiModelProperty(value = "指标类型")
        @NotEmpty(message = "指标类型集合不能为空")
        private List<String> indicatorTypes;

        private List<String> monitorIds;

    }

    @Data
    public static class StrategyUpParam {
        @ApiModelProperty(value = "预警单id")
        private String id;

        @ApiModelProperty(value = "预警单名称")
        @NotBlank(message = "名称不能为空")
        private String name;

        @ApiModelProperty(value = "部门id")
        private String deptId;

        @ApiModelProperty(value = "0.通用策略  1.定值策略")
        @NotNull(message = "策略选择不能为空")
        private Integer bigType;

        @ApiModelProperty(value = "区分预警单还是告警单(0：预警单；1：告警单)")
        @NotNull(message = "区分类别不能为空")
        private Integer type;

        @ApiModelProperty(value = "等级（0：一级；1：二级；2：三级）")
        @NotNull(message = "等级不能为空")
        private Integer grade;

    }

    @Data
    public static class StrategyStateParam {
        @ApiModelProperty(value = "预警单id")
        @NotBlank(message = "id不能为空")
        private String id;

        @ApiModelProperty(value = "0.删除 1.启用 2.关闭")
        private Integer state;

    }

    @Data
    public static class MonitorTree {

        @ApiModelProperty("id")
        private String id;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("子节点详细信息")
        private List<?> children;
    }

    @Data
    public static class Monitor {
        @ApiModelProperty("id")
        private String id;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("标识")
        private Integer leven=3;
    }
}
