package com.ruoyi.xq.enums.syspush;

import lombok.Getter;

@Getter
public enum SystemPushTypeEnum {
    // 消息类型:0=纯文字消息,1=文本消息,2=单图文消息,3=多图文消息
    SIMPLE_TEXT(0,"纯文字消息"),
    TEXT(1,"文本消息"),
    SIMPLE_IMAGE_TEXT(2,"单图文消息"),
    IMAGE_TEXT(3,"多图文消息"),
    ONLY_IMAGE(4,"纯图文消息"),
    ;
    private final Integer code;
    private final String text;

    SystemPushTypeEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public static SystemPushTypeEnum getByCode(Integer type) {
        SystemPushTypeEnum[] values = SystemPushTypeEnum.values();
        for (SystemPushTypeEnum value : values) {
            if(value.getCode().equals(type)){
                return value;
            }
        }
        return null;
    }
}
