package com.ruoyi.iot.domain.response;

import com.ruoyi.iot.enums.IotHttpStatus;
import lombok.Data;

import java.util.Objects;

/**
 * 命令下发响应
 * @author wjh
 * 2024/3/20
 */
@Data
public class CommandResponse extends BaseResponse {
    private Object data;
    private String cmdUuid;
    private String cmdResp;

    public boolean isSuccess() {
        return Objects.equals(IotHttpStatus.SUCCESS.getCode(), this.getCode());
    }

    // 设备不在线
    public boolean isNotOnline() {
        return Objects.equals(IotHttpStatus.DEVICE_NOT_ONLINE.getCode(), this.getCode());
    }

    // 命令超时
    public boolean isCmdTimeout() {
        return Objects.equals(IotHttpStatus.TIME_OUT.getCode(), this.getCode());
    }

}
