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

com.gitee.cn9750wang.webtools.error.defines.AuthErr Maven / Gradle / Ivy

The newest version!
/*
 *    Copyright 2021 wwy
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package com.gitee.cn9750wang.webtools.error.defines;

import com.gitee.cn9750wang.webtools.error.ErrorCode;
import com.gitee.cn9750wang.webtools.vo.result.error.ErrorMessage;
import static com.gitee.cn9750wang.webtools.error.defines.Errors.A;

/**
 * 认证错误
 *
 * @author wwy
 */
public enum AuthErr implements ErrEnum{
    /** 用户未进行身份认证 */
    UNAUTHORIZED(A,"用户未进行身份认证"),
    /** 用户认证凭据错误 */
    BAD_TOKEN(A.increase(1),"用户认证凭据错误"),

    /** 账户被冻结 */
    FREEZE(A.increase(2),"账户被冻结"),
    /** 拒绝访问 */
    FORBIDDEN(A.increase(3),"拒绝访问"),


    /** 用户认证凭据授权超时 */
    TOKEN_EXPIRE(A.increase(4),"用户认证凭据授权过期"),
    /** 用户认证凭据认证失败 */
    TOKEN_FAILED(A.increase(5),"用户认证凭据认证失败"),

    /** 客户端IP:[%s]被禁止访问 */
    BAN_IP(A.increase(6),"客户端IP:[%s]被禁止访问"),

    /** 登录失败 */
    LOGIN_FAILED(A.increase(7),"登录失败"),
    /** 登录失败次数过多,当前已禁用登录 */
    BAN_TRY_LOGIN(A.increase(8),"登录失败次数过多,当前已禁用登录"),

    /** 验证码验证错误 */
    CAPTCHA_ERR(A.increase(9),"验证码验证错误"),
    /** 验证码已失效 */
    INVALID_CAPTCHA(A.increase(10),"验证码已失效"),
    /** 需要输入验证码 */
    CAPTCHA_NEED(A.increase(11),"需要输入验证码"),

    ;

    AuthErr(ErrorCode code, String msg){
        this(new ErrorMessage(code,msg));
    }

    AuthErr(ErrorMessage message){
        this.message = message;
    }

    private final ErrorMessage message;

    @Override
    public ErrorMessage getMessage() {
        return message;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy