You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
841 B
Java
43 lines
841 B
Java
package com.example.util;
|
|
|
|
|
|
/**
|
|
* @Description 枚举一些常用API操作码
|
|
* @Author JacksonTu
|
|
* @Date 2020/3/28 16:26
|
|
*/
|
|
public enum ResultCode implements IErrorCode {
|
|
|
|
SUCCESS(0, "操作成功"),
|
|
FAILED(500, "操作失败"),
|
|
VALIDATE_FAILED(404, "参数检验失败"),
|
|
UNAUTHORIZED(401, "暂未登录或token已经过期"),
|
|
FORBIDDEN(403, "没有相关权限"),
|
|
PREVENT_REPLAY(405,"重复请求"),
|
|
NOT_EXIST(601,"数据不存在"),
|
|
NOT_ENABLE(600,"数据未启用");
|
|
|
|
|
|
|
|
|
|
private Integer code;
|
|
private String message;
|
|
|
|
private ResultCode(Integer code, String message) {
|
|
this.code = code;
|
|
this.message = message;
|
|
}
|
|
|
|
@Override
|
|
public Integer getCode() {
|
|
return code;
|
|
}
|
|
|
|
@Override
|
|
public String getMessage() {
|
|
return message;
|
|
}
|
|
|
|
|
|
}
|