Bläddra i källkod

更新文件类型和视频文件 URL 类型

reghao 3 år sedan
förälder
incheckning
d5de1bc289

+ 0 - 36
src/main/java/cn/reghao/dfs/store/model/constant/FileMsgType.java

@@ -1,36 +0,0 @@
-package cn.reghao.dfs.store.model.constant;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author reghao
- * @date 2022-04-20 14:57:36
- */
-public enum FileMsgType {
-    image(1, "图片"), audio(2, "音频"), video(3, "视频"), attachment(4, "附件");
-
-    private final Integer code;
-    private final String desc;
-
-    private static Map<Integer, String> descMap = new HashMap<>();
-    static {
-        for (FileMsgType type : FileMsgType.values()) {
-            descMap.put(type.code, type.desc);
-        }
-    }
-
-    FileMsgType(Integer code, String desc) {
-        this.code = code;
-        this.desc = desc;
-    }
-
-    public Integer getCode() {
-        return code;
-    }
-
-    // TODO 第一次调用时会初始化 descMap
-    public static String getDescByCode(int code) {
-        return descMap.get(code);
-    }
-}

+ 27 - 7
src/main/java/cn/reghao/dfs/store/model/constant/FileType.java

@@ -1,18 +1,38 @@
 package cn.reghao.dfs.store.model.constant;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
+ * 文件类型
+ *
  * @author reghao
- * @date 2021-11-22 10:03:14
+ * @date 2022-04-20 14:57:36
  */
 public enum FileType {
-    mp4("video/mp4"), mov("video/quicktime"), jpg("image/jpeg");
+    image(1, "图片"), audio(2, "音频"), video(3, "视频"), attachment(4, "附件");
+
+    private final Integer code;
+    private final String desc;
+
+    private static Map<Integer, String> descMap = new HashMap<>();
+    static {
+        for (FileType type : FileType.values()) {
+            descMap.put(type.code, type.desc);
+        }
+    }
+
+    FileType(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
 
-    private final String contentType;
-    FileType(String contentType) {
-        this.contentType = contentType;
+    public Integer getCode() {
+        return code;
     }
 
-    public String getContentType() {
-        return contentType;
+    // TODO 第一次调用时会初始化 descMap
+    public static String getDescByCode(int code) {
+        return descMap.get(code);
     }
 }

+ 2 - 0
src/main/java/cn/reghao/dfs/store/model/constant/VideoUrlType.java

@@ -1,6 +1,8 @@
 package cn.reghao.dfs.store.model.constant;
 
 /**
+ * 视频文件 URL 类型
+ *
  * @author reghao
  * @date 2021-08-01 22:22:15
  */