package com.xy.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 设备配件表
 * </p>
 *
 * @author lijin
 * @since 2024-02-02
 */
public class DevicePartDto {

    @Data
    @Accessors(chain = true)
    public static class SelectList extends Vo {

    }
    @Data
    @Accessors(chain = true)
    public static class CheckWeightOpenDTO {
        @NotNull(message = "deviceId不能为空")
        @ApiModelProperty(value = "设备id", required = true)
        private Long deviceId;
    }
    @Data
    @Accessors(chain = true)
    public static class SaveOrUpdate extends Vo {

        @NotNull(message = "deviceId不能为空")
        @ApiModelProperty(value = "设备id", required = true)
        private Long deviceId;

        @NotBlank(message = "code不能为空")
        @ApiModelProperty(value = "编码", required = true)
        private String code;

        @ApiModelProperty(value = "是否删除")
        private Boolean isRemove = false;
    }

    @Data
    @Accessors(chain = true)
    public static class Vo {

        private Long id;

        @ApiModelProperty(value = "设备id")
        private Long deviceId;

        @ApiModelProperty(value = "编码")
        private String code;

        @ApiModelProperty(value = "值 扩展用，如配件版本等")
        private String value;

        @ApiModelProperty(value = "创建时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime createTime;

        @ApiModelProperty(value = "更新时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime updateTime;


    }

}
