医院废弃物信息化管理平台
“mitao”
2025-12-24 3763145f34d7706923d55edc32f5cfbc8bc08b92
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package cn.besteam.common.constant;
 
import lombok.Getter;
 
import java.util.HashMap;
import java.util.Map;
 
/**
 * @author Kinsey Huang
 * @email 996842803@qq.com
 * @date 2019/4/1 1:09 PM
 * @Describe oss类型(文件类型 < - - - > 上传类型)
 */
public enum OssTypeEM {//找不到文件类型
 
    Empty("empty", null)
    //bmp文件
    , BMP("bmp", "image/bmp")
    //gif文件
    , GIF("gif", "image/gif")
    //jpeg文件
    , JPEG("jpeg", "image/jpeg")
    //jpg文件
    , JPG("jpg", "image/jpeg")
    //png文件
    , PNG("png", "image/png")
    //html文件
    , HTML("html", "text/html")
    //txt文件
    , TXT("txt", "text/plain")
    //pptx文件
    , PPTX("pptx", "application/vnd.ms-powerpoint")
    //ppt文件
    , PPT("ppt", "application/vnd.ms-powerpoint")
    //docx文件
    , DOCX("docx", "application/msword")
    //doc文件
    , DOC("doc", "application/msword")
    //xml文件
    , XML("xml", "text/xml")
    //mp3文件
    , MP3("mp3", "audio/mpeg"), MP4("mp4", "video/mpeg4");
 
    /**
     * 文件类型
     */
    @Getter
    private String fileType;
 
    /**
     * 上传类型
     */
    @Getter
    private String contentType;
 
    OssTypeEM(String fileType, String contentType) {
 
        this.fileType = fileType;
        this.contentType = contentType;
    }
 
    /**
     * 存储所有此类型枚举
     */
    public static final Map<String, OssTypeEM> MAP = new HashMap<>();
 
    static {
        for (OssTypeEM item : OssTypeEM.values()) {
            MAP.put(item.fileType, item);
        }
    }
 
    /**
     * @param fileType 文件类型
     * @return 对应的枚举实例
     * @Describe 根据文件类型获取对应oss类型
     */
    public static OssTypeEM getByFileType(String fileType) {
 
        return MAP.getOrDefault(fileType, OssTypeEM.Empty);
    }}