Files
tkcrawl-client/src/main/java/com/yupi/springbootinit/common/ErrorCode.java
2025-07-24 21:10:47 +08:00

52 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.yupi.springbootinit.common;
/**
* 自定义错误码
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
public enum ErrorCode {
SUCCESS(0, "ok"),
PARAMS_ERROR(40000, "请求参数错误"),
NOT_LOGIN_ERROR(40100, "未登录"),
USERNAME_OR_PASSWORD_ERROR(40200, "账号或密码错误"),
USER_DISABLE(40300, "用户被禁用"),
TOKEN_INVALID(40400, "Token无效请重新登录"),
NO_AUTH_ERROR(40101, "无权限"),
PACKAGE_EXPIRED(40500, "套餐已到期"),
NOT_FOUND_ERROR(40800, "请求数据不存在"),
FORBIDDEN_ERROR(40300, "禁止访问"),
TENANT_NAME_NOT_EXISTS(40600, "租户不存在"),
LOGIN_NOW_ALLOWED(40700, "当前账号没有登录权限"),
SYSTEM_ERROR(50000, "系统内部异常"),
OPERATION_ERROR(50001, "操作失败"),
QUEUE_ERROR(60001, "队列消息添加失败"),
QUEUE_CONSUMPTION_FAILURE(60001, "队列消息消费失败");
/**
* 状态码
*/
private final int code;
/**
* 信息
*/
private final String message;
ErrorCode(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}