package com.jkcredit.invoice.common;

import lombok.Getter;
import lombok.ToString;

/**
 * @Description: 返回码枚举
 * @Author junqiang.lu
 * @Date 2018/5/22
 */
@Getter
@ToString
public enum ResponseCode {

    /**
     * 成功与失败
     */
    SUCCESS(1, 200, "成功"),
    FAILQUERYNO(2, 200, "未查得"),
    FAIL(3, 200, "失败"),
    /**
     * 参数异常
     */
    ACCOUNT_NOT_EXIST(3, 1000, "无效用户"),
    PARAM_NOT_NULL(3, 1010, "参数不能为空"),

    MEDIA_TYPE_NOT_SUPPORT_ERROR(3, 1020, "参数类型不正确"),
    ONE_DAY_QUERY_ERROR(3, 1030, "单日查询次数到达上限"),
    SIGN_ERROR(3, 1040, "appkey错误/签名校验失败"),
    TIME_ERROR(3, 1050, "账号使用时间未到"),
    TIME_OUT_ERROR(3, 1060, "账号使用时间已过"),
    ALL_DAY_QUERY_ERROR(3, 1070, "总查询次数到达上限"),
    CUSTOMER_QUERY_ERROR(3, 1080, "商户模块未配置"),
    BALANCE_QUERY_ERROR(3, 1090, "商户余额不足"),
    API_QUERY_ERROR(3, 1100, "请求的API模块不存在"),
    TIME_QUERY_ERROR(3, 1110, "商户单位时间内请求超过限制"),
    OTHER_ERROR(3, 9999, "其他异常-"),

    /**
     * 其他
     */
    UNKNOWN_ERROR(3, 500, "系统异常,内部执行错误");

    /**
     * 返回码
     */
    private int code;

    /**
     * 返回信息
     */
    private String msg;

    /**
     * 返回状态
     */
    private int data;

    ResponseCode(int data, int code, String msg) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

}
