package com.jiayue.ipfcst.console.dto;

import lombok.Data;

/**
 * @description:
 * @author: yh
 * @create: 2020-03-03 13:22
 **/
@Data
public class ResponseBean {

    private Integer code;
    private String message;
    private Object data;


    public ResponseBean(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public final static ResponseBean ok(String message) {
        return new ResponseBean(0, message, null);
    }

    public final static ResponseBean error(String message) {
        return new ResponseBean(1, message, null);
    }

    public final static ResponseBean ok(String message, Object object) {
        return new ResponseBean(0, message, object);
    }

    public final static ResponseBean error(String message, Object object) {
        return new ResponseBean(1, message, object);
    }
}
