package com.xy.dto;

import cn.hutool.json.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xy.utils.enums.MqttCommandStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

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

@Data
@Accessors(chain = true)
public class AckMqttDto {

    @NotNull(message = "sn不能为空")
    @ApiModelProperty(value = "sn编号", required = true)
    private Long sn;

    @NotNull(message = "status不能为空")
    @ApiModelProperty(value = "状态", required = true)
    private MqttCommandStatusEnum statusEnum;

    @NotNull(message = "backClientTime不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "上报时间 yyyy-MM-dd HH:mm:ss", required = true)
    private LocalDateTime backClientTime;

    @ApiModelProperty(value = "执行结果")
    private JSONObject result;
}
