package com.zd.common.core.enums;

import java.util.Arrays;

/**
 * 用户消息类型
 *
 * @Author: zhoupan
 * @Date: 2021/09/26/17:57
 * @Description:
 */
public enum UserMessageType implements BaseEnum<Integer> {

    ADMIN(0, "管理员消息"),
    RISKPLAN(1, "风险预案消息"),
    ;

    private Integer code;
    private String name;

    UserMessageType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static UserMessageType getByCode(Integer code) {
        return Arrays.stream(UserMessageType.values()).filter(a -> a.code.equals(code)).findFirst().orElse(null);
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    @Override
    public Integer getDictKey() {
        return code;
    }

}
