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

top.gink.cas.exception.CustError Maven / Gradle / Ivy

The newest version!
package top.gink.cas.exception;


/**
 * @author Gink
 * @create 2019/10/18 12:44 下午
 */
public enum CustError {
    ERROR(1, "服务异常"),
    NEED_LOGIN(100_000_001, "需要登录"),

    ;
    public int code;
    public String desc;

    CustError(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CustError byCode(int code) {
        for (CustError val : values()) {
            if (val.code == code) {
                return val;
            }
        }
        throw new RuntimeException("未知的code");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy