package com.xy.dto;

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

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

@Data
@ApiModel("设备-状态")
@Accessors(chain = true)
public class DeviceStatusDto {

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

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

        @ApiModelProperty("appKey")
        private String appKey;

        @ApiModelProperty("机器当前版本")
        private String version;
    }

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

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

        @ApiModelProperty("左柜门状态")
        private Integer doorStateL;

        @ApiModelProperty("右柜门状态")
        private Integer doorStateR;

        @ApiModelProperty("类型 1=交易 2=补货 3=其他")
        private Integer type = 3;
    }

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

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

        @NotNull(message = "联网状态不能为空")
        @ApiModelProperty("联网状态")
        private Integer netState;


    }


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

        @ApiModelProperty("设备ID")
        private List<Long> deviceIds;
    }

    @Data
    @Accessors(chain = true)
    public static class Vo {
        @ApiModelProperty("设备ID")
        private Long deviceId;

        @ApiModelProperty("系统启动时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime sysStartTime;

        @ApiModelProperty("系统当前时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime sysCurTime;

        @ApiModelProperty("机器是否通电")
        private Integer sysPower;

        @ApiModelProperty("WIFI是否打开")
        private Integer wifiOpen;

        @ApiModelProperty("蓝牙是否打开")
        private Integer bloothOpen;

        @ApiModelProperty("联网状态")
        private Integer netState;

        @ApiModelProperty("联网类型")
        private String netType;

        @ApiModelProperty("联网信号强度")
        private Integer netDbm;

        @ApiModelProperty("左柜门状态")
        private Integer doorStateL;

        @ApiModelProperty("右柜门状态")
        private Integer doorStateR;

        @ApiModelProperty("左柜门锁状态")
        private Integer lockStateL;

        @ApiModelProperty("右柜门锁状态")
        private Integer lockStateR;

        @ApiModelProperty("温度值")
        private Integer tempValue;

        @ApiModelProperty("温控仪状态")
        private Integer tempState;

        @ApiModelProperty("音量")
        private Integer voiceVolume;

        @ApiModelProperty("主灯状态")
        private Integer lightMain;

        @ApiModelProperty("副灯状态")
        private Integer lightSecond;

        @ApiModelProperty("磁盘空间")
        private Integer diskSpace;

        @ApiModelProperty("磁盘剩余空间")
        private Integer diskRemainSpace;

        @ApiModelProperty("内存容量")
        private Integer memerySpace;

        @ApiModelProperty("内存剩余容量")
        private Integer memeryRemainSpace;

        @ApiModelProperty("左柜主摄像头状态")
        private Integer cameraLMainState;

        @ApiModelProperty("左柜副摄像头状态")
        private Integer cameraLSecondState;

        @ApiModelProperty("右柜主摄像头状态")
        private Integer cameraRMainState;

        @ApiModelProperty("右柜副摄像头状态")
        private Integer cameraRSecondState;

        @ApiModelProperty("左门锁机状态")
        private Integer deviceStateL;

        @ApiModelProperty("右门锁机状态")
        private Integer deviceStateR;

        @ApiModelProperty("是否使用电池")
        private Boolean isUseBattery;

        @ApiModelProperty("是否可交易")
        private Boolean isPay;

        @ApiModelProperty("机柜左门状态")
        private Integer jg1LockStateL;

        @ApiModelProperty("机柜右门状态")
        private Integer jg1LockStateR;

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

        /**
         * 设备商品在售库存数
         */
        @ApiModelProperty("可售库存")
        private Integer stock;

        /**
         * 最近一次补货后的库存数
         */
        @ApiModelProperty("上次补货后库存")
        private Integer afterFillStock;

        /**
         * 缺货状态
         */
        @ApiModelProperty("缺货状态")
        private Integer stockStatus;

    }

}
