All Downloads are FREE. Search and download functionalities are using the official Maven repository.

vip.efactory.common.i18n.enums.CommonEnum Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package vip.efactory.common.i18n.enums;


import lombok.Getter;

/**
 * 通用的,不便分类的枚举类型
 */
@Getter
public enum CommonEnum implements IBaseErrorEnum {
    SUCCESS(0, "成功"),
    ERROR(1, "未知错误"),
    ;

    private int errorCode;
    private String reason;
    private static final int MODULE_TYPE = ModuleTypeDefine.COMMON;
    private static int offset = ErrorCodeUtil.register(MODULE_TYPE);

    CommonEnum(int errorCode, String reason) {
        this.errorCode = errorCode;
        this.reason = reason;
    }


    public int getErrorCode() {
        return errorCode + offset;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy