package com.zfire.jiasm.syncdata.helper;

import io.swagger.annotations.ApiModel;

@ApiModel
//@Getter
//@Setter
//@NoArgsConstructor
public class ResponseExHelper<T>  {

	public static int ResponseCode_Success = 1; //成功
    public static int ResponseCode_COMMON = 501;//通用拦截提示
    public static int ResponseCode_AUTH_ERROR = 130;//非法请求
	
	private Integer statusCode;
	
	private Integer messageCode;
	
	private Integer total;
	
	private String exception;
	
	private String timestamp;
	
	private T data;
    private String message;
    private int code;
    
    public ResponseExHelper(String s) {
    	
    }
    
    public ResponseExHelper() {
    	
    }
    
    public static ResponseExHelper  success() {
        ResponseExHelper  object = new ResponseExHelper (ResponseCode_Success, "success");
        return object;
    }

    public static ResponseExHelper  success(Object data) {
        ResponseExHelper  object = new ResponseExHelper (ResponseCode_Success, "success");
        object.setData(data);
        return object;
    }

    public static ResponseExHelper  error(String msg) {
        ResponseExHelper  object = new ResponseExHelper (ResponseCode_COMMON, msg);
        return object;
    }

    public static ResponseExHelper  error(int code, String msg) {
        ResponseExHelper  object = new ResponseExHelper (code, msg);
        return object;
    }

    public T getData() {
        return data;
    }

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

    public ResponseExHelper(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public int getCode() {
        return code;
    }

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


    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    
    public Integer getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(Integer statusCode) {
		this.statusCode = statusCode;
	}

	public Integer getMessageCode() {
		return messageCode;
	}

	public void setMessageCode(Integer messageCode) {
		this.messageCode = messageCode;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public String getException() {
		return exception;
	}

	public void setException(String exception) {
		this.exception = exception;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}
}
