xiangpei
2025-04-18 ccadf9480d4e6a9dcc227a2a0b1f9ae0612e36fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.monkeylessey.enums;
 
 
import java.util.Arrays;
import java.util.List;
 
/**
 * oss文件分类目录,文件类型白名单
 * @author 29443
 *
 */
 
public enum FileTypeEnum {
 
    IMAGE("image", "图片", Arrays.asList("jpg", "png", "jpeg")),
    VIDEO("video", "视频", Arrays.asList("mp4", "avi", "rmvb", "mov")),
    RADIO("radio", "音频", Arrays.asList("mp3", "wma", "wav", "mpeg-4", "cd", "m4a")),
    TEXT("text", "文本文件", Arrays.asList("txt", "xls", "xlsx", "doc", "docx", "pdf")),
    ZIP("zip", "压缩文件", Arrays.asList("zip"));
 
    /**
     * 类型
     */
    private final String type;
 
    /**
     * 类型对应的后缀
     */
    private final List<String> suffixs;
 
    /**
     * 描述
     */
    private final String desc;
 
    FileTypeEnum(String type, String desc, List<String> suffixs) {
        this.type = type;
        this.suffixs = suffixs;
        this.desc = desc;
    }
 
    public String getType() {
        return type;
    }
 
    public List<String> getSuffixs() {
        return suffixs;
    }
}