package com.ruoyi.info.management.exception;

import com.ruoyi.common.enums.IIntegerEnum;
import java.util.Objects;


/**
 * 异常枚举
 */
public enum ManagementTeacherExceptionEnum implements IIntegerEnum {

    // TODO 注意检查错误码，保证系统内唯一
    MANAGEMENT_TEACHER_IS_NOT_EXISTS(210001, "管理老师信息不存在"),

    MANAGEMENT_TEACHER_DEPARTMENT_CANT_RELATED(210002, "部门不可已被关联"),

    ;

    private Integer code;

    private String msg;

    ManagementTeacherExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static ManagementTeacherExceptionEnum getByCode(int code, ManagementTeacherExceptionEnum[] values) {
        for (ManagementTeacherExceptionEnum value : values) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }

}
