package cn.iocoder.yudao.module.system.enums.notice;

import cn.hutool.core.util.ArrayUtil;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 *
 * 消息类型枚举
 * @author jinyd
 */
@AllArgsConstructor
@Getter
public enum NotifyTypeEnum implements ArrayValuable<Integer> {

    NOTIFY_TODO(0, "代办"), //代办
    NOTIFY_READ(1, "待阅"), //待阅
    NOTIFY_COPY(2, "抄送"); //抄送

    public static final Integer[] ARRAYS = Arrays.stream(values()).map(NotifyTypeEnum::getValue).toArray(Integer[]::new);

    /**
     * 类型
     */
    private final Integer value;
    /**
     * 转改名
     */
    private final String name;

    public static NotifyTypeEnum valueOf(Integer value) {
        return ArrayUtil.firstMatch(businessType -> businessType.getValue().equals(value), NotifyTypeEnum.values());
    }

    @Override
    public Integer[] array() {
        return ARRAYS;
    }

}
