package cn.pluss.platform.alidevice;

import lombok.Data;

/**
 *
 *封装阿里云设备 RespDeviceEntity
 *@author: bzg
 *@time: 2021/12/23 10:22
 */
@Data
public class RespDeviceEntity<T> {

    private Integer code;

    private String message;

    private T data;

    public RespDeviceEntity(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public RespDeviceEntity(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static RespDeviceEntity success(String message, Object data){
        return new RespDeviceEntity(0,message,data);
    }

    public static RespDeviceEntity fail(String message){
        return new RespDeviceEntity(1,message);
    }

    public static RespDeviceEntity fail(String message,Object data){
        return new RespDeviceEntity(1,message,data);
    }

    public static RespDeviceEntity await(String message,Object data){
        return new RespDeviceEntity(2,message,data);
    }
}
