package com.ycl.enums.common; import com.ycl.api.IErrorCode; /** * 枚举了一些常用API操作码 * * @author lyq * @since 2022-09-06 */ public enum ResultCode implements IErrorCode { API_SUCCESS(0, "操作成功"), SUCCESS(200, "操作成功"), FAILED(500, "操作失败"), VALIDATE_FAILED(404, "参数检验失败"), UNAUTHORIZED(401, "暂未登录或token已经过期"), FORBIDDEN(403, "没有相关权限"), NULL_PARAMETER(-3, "空参"), RECORD_ALREADY_EXISTS(2001, "记录已存在"), RECORD_SAVE_FAIL(2002, "记录保存失败"), RECORD_UPDATE_FAIL(2003, "记录更新失败"), RECORD_DELETE_FAIL(2004, "记录删除失败"), RECORD_NOT_EXISTS(2005, "记录不存在"), FILE_NOT_FOUND(2006, "文件不存在"), FILE_TYPE_FAIL(2007, "文件格式错误"), CAR_NUMBER_REPETITION(2008, "车牌号重复"), NOT_LOGGED(2015, "未登录,请登录后操作"), LOGIN_TIMEOUT(2016, "登录超时,请重新登录"), OPERATOR_TYPE_FETCH_FAIL(3001, "获取操作员失败"), APPID_ERROR(3002, "appId错误"), APPKEY_ERROR(3003, "appKey错误"), SIGN_ERROR(3004,"sign错误"); private long code; private String message; private ResultCode(long code, String message) { this.code = code; this.message = message; } public long getCode() { return code; } public String getMessage() { return message; } }