package com.elephant.framework.galaxy.aroad.exception;

/**
 * @Description
 * @auther wangjian
 * @create 2019-02-18 15:48
 */
public enum GlobalExceptionEnum implements CommonError {

    // 通用错误码定义
    UNKNOWN_ERROR(10001, "未知错误"),
    PARAMETER_VALIDATION_ERROR(10002, "非法参数"),

    // 20000 用户相关错误码定义
    USER_NOT_EXIST(20001, "用户不存在"),
    MENU_HAS_CHILD(20002, "菜单含有下级不能删除"),


    ;


    private int errorCode;
    private String errorMessage;


    private GlobalExceptionEnum(int errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    @Override
    public int getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrorMessage() {
        return this.errorMessage;
    }

    @Override
    public CommonError setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }}
