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 ReceiverType {
    ENTERPRISE(1L, "企业管理员"), //
    DRIVER(2L, "驾驶员");

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

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

}
