package com.hotwj.platform.noticeManagerment.systemNotification.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Objects;
import java.util.stream.Stream;

/**
 * 消息等级类型
 * <p>
 */
@Getter
@RequiredArgsConstructor
public enum LevelType {
    NORMAL(1L, "普通"), //
    EMERGENCY(2L, "紧急");

    /**
     * 类型
     */
    private final Long type;
    /**
     * 类型名
     */
    private final String name;

    public static LevelType toType(Long type) {
        return Stream.of(LevelType.values()).filter(p -> Objects.equals(p.type, type)).findAny().orElse(null);
    }

}
