package com.fdkankan.fyun.constant;

public enum FYunTypeEnum {
    OSS("oss", "阿里云"),
    AWS("aws", "亚马逊"),
    COS("cos", "腾讯云"),
    LOCAL("local", "本地"),
    HTTPS("https", "通过https请求文件"),

    OBS("obs", "华为云");

    private String code;
    private String message;

    private FYunTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String code() {
        return code;
    }

    public String message() {
        return message;
    }

    public static FYunTypeEnum get(String code) {
        FYunTypeEnum[] values = FYunTypeEnum.values();
        String enumValue = null;
        for (FYunTypeEnum eachValue : values) {
            enumValue = eachValue.code();
            if (enumValue.equals(code)) {
                return eachValue;
            }
        }
        return null;
    }
}
