package com.fdkankan.fyun.constant;

public enum StorageType {

    OSS("oss", "阿里云"),
    AWS("aws", "亚马逊"),
    LOCAL("local", "本地");

    private String code;
    private String message;

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

    public String code() {
        return code;
    }

    public String message() {
        return message;
    }

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

}
