package com.winsun.constant;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * 排序
 * @author Liph
 * @datetime 2019-09-19/9/27 11:19
 */
public enum FilePath {
    //
    BACKGROUNDIMG("套餐背景图片基础路径","enclosure"),
    PATH("一人一码基础路径","enclosure/images/");
    FilePath(String id, String value) {
        this.id = id;
        this.value = value;
    };

    private static final Map<String, FilePath> DATAS = new HashMap<>();
    static {
        Arrays.asList(values()).forEach(data -> DATAS.put(data.getId(), data));
    }

    private String id;

    private String value;

    public String getId() {
        return id;
    }

    public String getValue() {
        return value;
    }

    public static FilePath findById(String id) {
        return DATAS.getOrDefault(id, null);
    }
}
