package com.qmth.jkserver.enums;

import java.util.Objects;

/**
 * @Description: 上传文件类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/7/15
 */
public enum UploadFileEnum {

    FILE("file");

    private String title;

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

    public String getTitle() {
        return title;
    }

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