package cn.edu.whu.boot.message.bean;

import com.alibaba.fastjson.JSON;

public class ResultMessage<T> {
    private boolean success=true;
    private String message="";
    private T data=null;
    private int status=200;
    public ResultMessage(String message){
        this.message = message;
    }

    public ResultMessage(String message, T data){
        this.success = success;
        this.data = data;
    }
    public ResultMessage(boolean success, String message){
        this.success = success;
        this.message = message;
    }

    public ResultMessage(boolean success, String message, T data){
        this.success = success;
        this.message = message;
        this.data = data;
    }

    public ResultMessage(boolean success, String message, int status){
        this.success = success;
        this.message = message;
        this.status = status;
    }

    public ResultMessage(boolean success, String message, T data, int status){
        this.success = success;
        this.message = message;
        this.data = data;
        this.status = status;
    }


    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}


