package com.yihu.hos.broker.models;

import com.yihu.hos.core.constants.ExceptionConstant;

import java.io.Serializable;

/**
 * Created by chenweida on 2016/1/27.
 */
public class GatewayResponseResult implements Serializable {
    private String responseCode = ExceptionConstant.EHREXCEPTION_SUCCESS;
    private String responseMessage = "";
    private String responseParams;
    private String requestId;
    private Object responseResult;

    public String getResponseCode() {
        return responseCode;
    }

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }

    public String getResponseMessage() {
        return responseMessage;
    }

    public void setResponseMessage(String responseMessage) {
        this.responseMessage = responseMessage;
    }

    public String getResponseParams() {
        return responseParams;
    }

    public void setResponseParams(String responseParams) {
        this.responseParams = responseParams;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public static GatewayResponseResult getSuccess(String responseParams, String requestId) {
        GatewayResponseResult responseModel = new GatewayResponseResult();
        responseModel.setRequestId(requestId);
        responseModel.setResponseParams(responseParams);
        return responseModel;
    }

    public static GatewayResponseResult getSuccess(String responseParams) {
        GatewayResponseResult responseModel = new GatewayResponseResult();
        responseModel.setResponseParams(responseParams);
        return responseModel;
    }

    public static GatewayResponseResult getError(String respCode, String respMessage) {
        GatewayResponseResult responseModel = new GatewayResponseResult();
        responseModel.setResponseCode(respCode);
        responseModel.setResponseMessage(respMessage);
        return responseModel;
    }

    @Override
    public String toString() {
        return "{" +
                "responseCode:'" + responseCode + '\'' +
                ", responseMessage:'" + responseMessage + '\'' +
                ", responseParams:'" + responseParams + '\'' +
                ", requestId:'" + requestId + '\'' +
                '}';
    }

    public Object getResponseResult() {
        return responseResult;
    }

    public void setResponseResult(Object responseResult) {
        this.responseResult = responseResult;
    }
}
