package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * 云阅卷同步方式
 */
public enum SyncModeEnum {

    BY_SCHOOL("按学校同步"),

    BY_COLLEGE("按学院同步");

    SyncModeEnum(String title) {
        this.title = title;
    }

    private String title;

    public String getTitle() {
        return title;
    }

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