package com.jkcredit.invoice.hub.spi.web.data;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description:
 * @author: xusonglin
 * @create: 2020/1/12 19:16
 * @version: V1.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseData {
    public static final int SUCCESS = 1;
    public static final int FAILED = 0;
    public static final String SUCCESS_MESSAGE = "成功";


    private Integer code;
    private String responseMessage;
    private Object responseData;

    public static ResponseData success(String message) {
        return new ResponseData(SUCCESS, message, null);
    }

    public static ResponseData failed(String message) {
        return new ResponseData(FAILED, message, null);
    }

    public static ResponseData success(Object object) {
        return new ResponseData(SUCCESS, SUCCESS_MESSAGE, object);
    }

    public static ResponseData success(String meaage, Object object) {
        return new ResponseData(SUCCESS, meaage, object);
    }
}
