package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * 考试类型
 */
public enum ExamCategoryEnum {

    ONLINE("线上考试"),

    OFFLINE("线下考试");

    private String desc;

    private ExamCategoryEnum(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 状态转换 toName
     *
     * @param value
     * @return
     */
    public static String convertToName(String value) {
        for (ExamCategoryEnum e : ExamCategoryEnum.values()) {
            if (Objects.equals(value.trim(), e.getDesc())) {
                return e.name();
            }
        }
        return null;
    }
}
