package com.chy.borrow.exception;

/**
 * @author ：沈晔浩
 * @date ：Created in 2021/9/14 17:23
 * @description：异常枚举类
 */
public enum ErrorEnum {
    // 数据操作错误定义
    SUCCESS(200, "nice"),
    NO_PERMISSION(403,"你没得权限"),
    NO_AUTH(401,"你能不能先登录一下"),
    NOT_FOUND(404, "未找到该资源!"),
    INTERNAL_SERVER_ERROR(500, "服务器跑路了"),

    SOURCE_EDIT_VALIDATE(30101, "该资源不能修改"),
    SOURCE_DELETE_VALIDATE(30102, "该资源不能删除"),
    HAS_NAME(30103,"名字重复"),
    TASK_IS_OPERATE(30201, "任务正在运行不能编辑"),



    ;

    /** 错误码 */
    private Integer errorCode;

    /** 错误信息 */
    private String errorMsg;

    ErrorEnum(Integer errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public Integer getErrorCode() {
        return errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
}
