package cn.iocoder.yudao.module.product.controller.admin.deviceinfo.vo;

import cn.iocoder.yudao.module.product.controller.admin.slavedevice.vo.SlaveDeviceSaveReqVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

@ApiModel("管理后台 - 设备信息创建 Request VO")
@Data
public class DeviceInfoSaveReqVO {

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

    @ApiModelProperty(value = "网关类型： 1：必联  2：有人", required = true)
    @NotNull(message = "网关类型不能为空")
    @Min(value = 1, message = "网关类型的取值范围为1~2之间")
    @Max(value = 2, message = "网关类型的取值范围为1~2之间")
    private Integer gatewayType;

    @ApiModelProperty(value = "设备类型： 1：控制器  2：传感器  3：监控", required = true)
    @NotNull(message = "设备类型不能为空")
    @Min(value = 1, message = "设备类型的取值范围为1~3之间")
    @Max(value = 3, message = "设备类型的取值范围为1~3之间")
    private Integer deviceType;

    @ApiModelProperty(value = "传感器对应的环境类型，关联product_env_type表的ID")
    private Long envType;

    @ApiModelProperty(value = "控制器字段")
    private String controllerField;

    @ApiModelProperty(value = "监控器编码, 内部请求用")
    private String monitorCode;

    @ApiModelProperty(value = "监控点名称")
    private String monitorPoints;

    @ApiModelProperty(value = "关闭指令（在网关类型为有人时读取该字段）")
    private String closeInstruction;

    @ApiModelProperty(value = "开启指令（在网关类型为有人时读取该字段）")
    private String openInstruction;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "从设备")
    @Valid
    private List<SlaveDeviceSaveReqVO> slaveDevices;
}
