package com.union.ai.api.dto;

import com.alibaba.fastjson.JSON;
import com.union.ai.api.enums.ErrorEnum;

/**
 * Created by IntelliJ IDEA.
 * Author: xingxin.jing
 * Date: 2019/4/5
 * Time: 下午5:19
 */
public class Result {

    private Integer error_code;

    private String error_msg;

    public Result() {
    }

    public Result(ErrorEnum errorEnum) {
        this.error_code = errorEnum.getCode();
        this.error_msg = errorEnum.getMessage();
    }

    public Result(Integer error_code, String error_msg) {
        this.error_code = error_code;
        this.error_msg = error_msg;
    }

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

    public Integer getError_code() {
        return error_code;
    }

    public void setError_code(Integer error_code) {
        this.error_code = error_code;
    }

    public String getError_msg() {
        return error_msg;
    }

    public void setError_msg(String error_msg) {
        this.error_msg = error_msg;
    }
}
