ソースを参照

设置云存储枚举值

tianboguang 3 年 前
コミット
8bf30f27cb

+ 35 - 0
4dkankan-utils-fyun-parent/src/main/java/com/fdkankan/fyun/constant/FYunTypeEnum.java

@@ -0,0 +1,35 @@
+package com.fdkankan.fyun.constant;
+
+public enum FYunTypeEnum {
+    OSS("oss", "阿里云"),
+    AWS("aws", "亚马逊"),
+    LOCAL("local", "本地");
+
+    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;
+    }
+}