package com.qmth.paper.library.common.enums;

import java.util.Objects;

/**
 * app应用来源
 */
public enum AppSourceEnum {

    SYSTEM("自身应用系统"),

    PAPER_LIBRARY("试卷电子化系统-后台"),

    PAPER_LIBRARY_CLIENT("试卷电子化系统-扫描端");

    private String title;

    private AppSourceEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

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