package com.dgt.graphdemo.exception;


import java.io.Serializable;

import static com.dgt.graphdemo.utils.ExpPrefixUtil.*;


/**
 * @Author lugela
 * @Date
 * 全局的异常状态码 和 异常描述
 *
 */
public enum ExpCodeEnum implements Serializable {

    /** 通用异常 */
    /*成功*/
    SUCCESS(  "0000", "成功"),

    /*1*/
    PARAM_NULL(ComExpPrefix + "001", "参数为空"),
    JSONERROR(ComExpPrefix + "002", "JSON解析异常"),
    HTTP_REQ_METHOD_ERROR(ComExpPrefix + "003", "HTTP请求方法不正确"),
    ADDfAILE(ComExpPrefix + "004", "添加失败"),
    UPDATEFAILE(ComExpPrefix + "005", "更新失败"),
    DELETEFAILE(ComExpPrefix +"006","删除失败"),
    TOKENNODATA(ComExpPrefix + "007", "认证码不存在"),
    TOKENPERMISSION(ComExpPrefix + "008", "认证码有误"),
    TOKENLOAD(ComExpPrefix + "009", "认证码失效"),
    SESSION_NULL(NotFoundExpPrefix + "010", "请求头中认证码不存在"),
    PARAMETERSMISSING(ComExpPrefix +"011","必传参数缺失"),
    QUREYRSMISSING(ComExpPrefix +"012","请求查询参数不合法"),
    USEREXISTS(ComExpPrefix +"013","该账号已经存在"),
    LOGINFAILURE(ComExpPrefix +"014","账号或密码错误"),
    /*2*/
    NULLVALUE (UserExpPrefix + "001", "没有查询到数据"),
    NOTFINDCUSTID(UserExpPrefix +"002","修改的客户未能查询到"),

    /*3*/
    NO_REPEAT(ProdExpPrefix + "001", "请勿重复提交"),
    JURISDICTION(ProdExpPrefix + "002", "无权限访问"),
    SYSCODEPERMISSION(ProdExpPrefix +"03","该账号无权限"),
    SERVERPERMISSION(ProdExpPrefix +"04","服务器无访问权限"),
    TOKENANDSERVERPERMISSION(ProdExpPrefix + "005", "服务器无访问权限，token有误"),
    /*4*/
    ERROR_404(NotFoundExpPrefix + "001", "没有该接口"),
    /*5*/
    UNKNOW_ERROR(AnlsExpPrefix+"001","未知异常");




    private String code;
    private String message;

    private ExpCodeEnum(String code, String message){
        this.code = code;
        this.message = message;
    }

    ExpCodeEnum(){}

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
