package com.xy.dto;

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

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

/**
 * <p>
 *
 * </p>
 *
 * @author hechunping
 * @since 2023/3/20
 */
@Data
@Accessors(chain = true)
public class DeviceTempSetDto {

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

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

        @ApiModelProperty(value = "工作模式")
        private String workMode;

        @ApiModelProperty(value = "最低温度报警")
        private Integer warningLow;

        @ApiModelProperty(value = "最高温度报警")
        private Integer warningHigh;

        @ApiModelProperty(value = "目标温度1")
        private Integer tempValue;

        @ApiModelProperty(value = "目标温度1")
        private Integer tempValue1;

        @ApiModelProperty(value = "目标温度2")
        private Integer tempValue2;

        @ApiModelProperty(value = "目标温度3")
        private Integer tempValue3;

        @ApiModelProperty(value = "工作时段1起始时间")
        private Integer job1StartTime;

        @ApiModelProperty(value = "工作时段1结束时间")
        private Integer job1EndTime;

        @ApiModelProperty(value = "工作时段2起始时间")
        private Integer job2StartTime;

        @ApiModelProperty(value = "工作时段2结束时间")
        private Integer job2EndTime;

        @ApiModelProperty(value = "工作时段3起始时间")
        private Integer job3StartTime;

        @ApiModelProperty(value = "工作时段3结束时间")
        private Integer job3EndTime;
    }

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

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

        @ApiModelProperty(value = "设置状态", required = true)
        private DeviceTempSetStatusEnum deviceTempSetStatusEnum;
    }

    @Data
    @Accessors(chain = true)
    public static class Vo {
        @ApiModelProperty(value = "id")
        private Integer id;

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

        @ApiModelProperty(value = "工作模式")
        private String workMode;

        @ApiModelProperty(value = "最低温度报警")
        private Integer warningLow;

        @ApiModelProperty(value = "最高温度报警")
        private Integer warningHigh;

        @ApiModelProperty(value = "目标温度")
        private Integer tempValue;

        @ApiModelProperty(value = "目标温度1")
        private Integer tempValue1;

        @ApiModelProperty(value = "目标温度2")
        private Integer tempValue2;

        @ApiModelProperty(value = "目标温度3")
        private Integer tempValue3;

        @ApiModelProperty(value = "工作时段1起始时间")
        private Integer job1StartTime;

        @ApiModelProperty(value = "工作时段1结束时间")
        private Integer job1EndTime;

        @ApiModelProperty(value = "工作时段2起始时间")
        private Integer job2StartTime;

        @ApiModelProperty(value = "工作时段2结束时间")
        private Integer job2EndTime;

        @ApiModelProperty(value = "工作时段3起始时间")
        private Integer job3StartTime;

        @ApiModelProperty(value = "工作时段3结束时间")
        private Integer job3EndTime;

        @ApiModelProperty(value = "设置状态")
        private String status;

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

        @ApiModelProperty(value = "创建人")
        private Long createUser;

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

}
