package com.fs.qw.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
public enum fileShowTypeEnum {
    UNKNOWN(0,"未知类型文件"),
    WORD(1,"word类型文件"),
    EXCEL(2,"excel类型文件"),
    RAR(3,"压缩包类型文件"),
    PDF(4,"pdf类型文件"),
    TXT(5,"txt纯文本类型文件"),
    PPT(6,"ppt类型文件");

    private Integer value;
    private String desc;

    public static fileShowTypeEnum toType(Integer value) {
        return Stream.of(fileShowTypeEnum.values())
                .filter(p -> p.value.equals(value))
                .findAny()
                .orElse(null);
    }
}
