package com.philisense.www.enums;

/**
 * @description: Oss类型
 **/
public enum OssTypeEnum {

    /**
     * 本地存储
     */
    LOCAL(0, "本地存储"),
    /**
     * 阿里云
     */
    ALIYUN(1, "阿里云"),

    /**
     * 七牛云
     */
    QINIU(2, "七牛云"),
    /**
     * 又拍云
     */
    UPYUN(3, "又拍云"),

    /**
     * Minio
     */
    MINIO(4, "Minio"),

    /**
     * FastDFS
     */
    GOFASTDFS(5, "GoFastDFS");

    private final int value;

    private final String name;

    OssTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    // 由传入的Key值返回对应的 OssTypeEnum
    public static OssTypeEnum getOssTypeEnumByValue(int key) {
        for (OssTypeEnum ossTypeEnum : values()) {
            if (ossTypeEnum.getValue() == key) {
                return ossTypeEnum;
            }
        }
        return null;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }
}
