|
|
|
package com.teaching.backend.common;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 自定义错误码
|
|
|
|
*
|
|
|
|
* @author <a href="https://github.com/liyh">程序员鱼皮</a>
|
|
|
|
* @from <a href="https://yh.icu">编程导航知识星球</a>
|
|
|
|
*/
|
|
|
|
public enum ErrorCode {
|
|
|
|
|
|
|
|
SUCCESS(200, "ok"),
|
|
|
|
PARAMS_ERROR(40000, "请求参数错误"),
|
|
|
|
OBJECTIVE_CONTENT_NOT_EXIT(40001, "目标内容不存在"),
|
|
|
|
KONWID_NOT_EXIT(40002, "没有选择知识点"),
|
|
|
|
OBJECTIVE_OR_CONTENT_EXIT(40003, "该记录已存在"),
|
|
|
|
KNOW_NOT_EXIT(40004, "知识点不存在"),
|
|
|
|
USERNAME_NOT_EXIT(40005, "缺少用户信息"),
|
|
|
|
STUDENT_NOT_EXIT(40006, "缺少学生信息"),
|
|
|
|
COURSES_NOT_EXIT(40007, "缺少课程信息"),
|
|
|
|
CONTENT_NOT_EXIT(40008, "内容id不存在"),
|
|
|
|
KNOWS_EXIT(40009, "该项下面存在关联的知识点,请在删除关联的知识点后再来操作!"),
|
|
|
|
INVALID_ROLE(400010, "角色不存在"),
|
|
|
|
MESSAGE_NO_READ(400011, "消息未读,禁止删除!"),
|
|
|
|
MESSAGE_NO_EXIT(400012, "消息不存在!"),
|
|
|
|
|
|
|
|
TOTOAL_OBJECTIVE_CANT_DELETE(400013, "课程总目标内容禁止删除!"),
|
|
|
|
CONTENT_HAS_NO_KNOWS(400014, "当前课程目标下面没有关联的知识点!"),
|
|
|
|
|
|
|
|
|
|
|
|
NOT_LOGIN_ERROR(40100, "未登录"),
|
|
|
|
NO_AUTH_ERROR(40101, "无权限"),
|
|
|
|
NOT_FOUND_ERROR(40400, "请求数据不存在"),
|
|
|
|
CONTENT_EXISTS(41000, "内容存在"),
|
|
|
|
STUDENT_ROLE_CANT_MULTIPLESEND(41001, "学生用户不能群发,只能单发"),
|
|
|
|
LEAST_ONE_USER(41002, "最少选择一个用户"),
|
|
|
|
MOST_ONE_COURSE(41003, "您一次性最多只能在一个课程下发消息!"),
|
|
|
|
KNOWS_EXISTS(41001, "存在关联的知识点"),
|
|
|
|
ADD_RELATION_FAILED(41002, "添加关系失败"),
|
|
|
|
|
|
|
|
|
|
|
|
FORBIDDEN_ERROR(40300, "禁止访问"),
|
|
|
|
|
|
|
|
PARAMS_ILLEGAL(42000, "请求参数违法"),
|
|
|
|
PARAMS_NULL(4001,"参数为空"),
|
|
|
|
|
|
|
|
PARAMS_USER_NOTEXISTS(4002,"用户不存在"),
|
|
|
|
|
|
|
|
PARAMS_RESOURCE_NOTEXISTS(4003,"资源不存在"),
|
|
|
|
|
|
|
|
PARAMS_COURSE_NOTEXISTS(4004,"课程不存在"),
|
|
|
|
PARAMS_EMPTY(40004, "参数为空"),
|
|
|
|
|
|
|
|
DELETE_FAILED(40005, "删除失败"),
|
|
|
|
UPLOAD_FAILED(40006, "上传失败"),
|
|
|
|
|
|
|
|
DELETE_RELATIONSHIP_FAILED(40006, "添加关系失败"),
|
|
|
|
|
|
|
|
KNOW_EXISIT(40007, "课程已存在"),
|
|
|
|
SYSTEM_ERROR(50000, "系统内部异常"),
|
|
|
|
FILE_ERROR(50010, "附件无效"),
|
|
|
|
UNKNOW_ERROR(50002, "系统内部异常"),
|
|
|
|
|
|
|
|
OPERATION_ERROR(50001, "操作失败");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 状态码
|
|
|
|
*/
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|