package com.ruoyi.enums.message;

import java.util.Arrays;

/**
 * 推送类型枚举
 * @Author liwenlong
 */
public enum PushEnums {

    /**
     * goeasy推送
     */
    goeasy(1, "goeasy推送"),


    /**
     * uniapp推送
     */
    uniapp(2, "uniapp推送"),


    ;

    private final Integer code;
    private final String name;

    public static String getName(Integer code) {
        return getPushEnums(code).name;
    }

    public static PushEnums getPushEnums(Integer code) {
        return Arrays.stream(PushEnums.values()).filter(c->c.getCode().equals(code)).findFirst().get();
    }

    PushEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


}
