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 SenderType {
    SYSTEM(1L, "系统"), //
    GOVERNMENT(2L, "政府端"),
    COMPANY(3L, "企业端");

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

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

}
