package com.ruoyi.ss.device.domain.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 设备IOT操作结果
 * @author wjh
 * 2024/12/21
 */
@Data
public class DeviceIotResultVO {

    @ApiModelProperty("数据库是否操作成功")
    private Integer db;

    @ApiModelProperty("IOT是否操作成功")
    private Boolean iot;

    @ApiModelProperty("失败原因")
    private String msg;

    public static DeviceIotResultVO fail(String msg) {
        DeviceIotResultVO vo = new DeviceIotResultVO();
        vo.setDb(0);
        vo.setIot(false);
        vo.setMsg(msg);
        return vo;
    }

    public static DeviceIotResultVO success(Integer db) {
        DeviceIotResultVO vo = new DeviceIotResultVO();
        vo.setDb(db);
        vo.setIot(true);
        return vo;
    }


}
