package com.ai.da.common.enums;

import java.util.stream.Stream;

/**
 * @author yanglei
 * @description 系统文件 一级类型枚举 Images icon accessories
 * @create 2022-10-6 17:33
 **/
public enum SysFileLevel1TypeEnum {

    IMAGES("Images", "images"),

    ICON_C("Iconc", "iconc"),

    ACCESSORIES("Accessories", "accessories");

    private String realName;
    /**
     * 上传路径名字
     */
    private String uploadPathName;

    SysFileLevel1TypeEnum(String realName, String uploadPathName) {
        this.realName = realName;
        this.uploadPathName = uploadPathName;
    }

    public String getRealName() {
        return realName;
    }

    public String getUploadPathName() {
        return uploadPathName;
    }

    public static SysFileLevel1TypeEnum uploadOf(String uploadPathName) {
        return Stream.of(SysFileLevel1TypeEnum.values()).filter(v -> v.getUploadPathName().equals(uploadPathName)).findFirst().orElse(null);
    }
}
