package cn.iocoder.yudao.module.pms.controller.admin.yanfan.var.slave.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

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

@Schema(description = "管理后台 - yf变量模板设备从机对象新增/修改 Request VO")
@Data
public class IotYfVarTempSalveSaveReqVO {

    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "705")
    private Long id;

    @Schema(description = "关联的模板id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5860")
    @NotNull(message = "关联的模板id不能为空")
    private Long deviceTempId;

    @Schema(description = "从机编号")
    private Integer slaveAddr;

    @Schema(description = "序号")
    private Integer slaveIndex;

    @Schema(description = "从机ip地址")
    private String slaveIp;

    @Schema(description = "从机名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
    @NotEmpty(message = "从机名称不能为空")
    private String slaveName;

    @Schema(description = "从机端口")
    private Integer slavePort;

    @Schema(description = "寄存器起始地址(10进制)")
    private Long addrStart;

    @Schema(description = "寄存器结束地址(10进制)")
    private Long addrEnd;

    @Schema(description = "寄存器批量读取个数")
    private Integer packetLength;

    @Schema(description = "批量获取轮询时间(默认5分钟)")
    private Long timer;

    @Schema(description = "状态 0-启动 1-失效", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态 0-启动 1-失效不能为空")
    private Integer status;

    @Schema(description = "功能编码")
    private Integer code;

    @Schema(description = "部门id", example = "22314")
    private Long deptId;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

}
