package com.smppw.common.pojo.enums;

import lombok.Getter;

/**
 * @author：zhouf
 * @date：2023/7/5
 * @description：
 */
@Getter
public enum FileType {
    PDF(1, ".pdf"),
    PPT(2, ".ppt"),
    PPTX(3,".pptx"),
    DOC(4,".doc");
    private final int type;
    private final String fileName;

    FileType(int type, String fileName) {
        this.type = type;
        this.fileName = fileName;
    }
    public static int  getIndex(String fileName) {
        for (FileType fileType:FileType.values()) {
            if (fileType.getFileName().equalsIgnoreCase(fileName)){
                return fileType.getType();
            }
        }
        return 0;
    }
}