package org.dromara.common.mq.enums;

public enum MessageActionEnum {


    SYSTEM_NOTIFY(10, "system"), // 系统->通知
    SYSTEM_REPORT(13, "system"), // 系统->举报下架（视频，视频评论） 视频评论
    SYSTEM_CHECK(14, "system"), // 系统->审核结果（复审，驳回 ，通过）
    SYSTEM_PUSH(15, "system"), //系统->推广类的
    INTERACTION_COMMENT(21, "interaction"), //互动->评论
    INTERACTION_AT(27, "interaction"), //互动->视频评论中的@
    INTERACTION_LIKE(28, "interaction"), //互动->点赞
    NEW_FOUCS(21,"newFocus"), //新的关注
    INTERACTION_REPLY(29, "interaction"), //互动->评论回复
    ORDER_RECHARGE(30, "order"), //订单->充值 online
    ORDER_PAY(31, "order"), //订单->订单交易成功通知 online
    ORDER_REFUND(32, "order"), //订单->退款结果通知
    GROUP_NOTIFY_CHECK(43, "groupNotify"), //群通知->进群申请 online
    GROUP_NOTIFY_ACCEPT(44, "groupNotify"), // 群通知->进群审核审核通过 online
    GROUP_NOTIFY_FAIL(45, "groupNotify"), // 群通知->进群审核审核拒绝 online
    GROUP_NOTIFY_LEAVE_UP(46, "groupNotify"), // 群通知->群升级为达人群通知
    GROUP_NOTIFY_LEAVE_DOWN(47, "groupNotify"); // 群通知->群降级为普通群通知

    private int code;
    private String account;

    MessageActionEnum(int code, String account) {
        this.code = code;
        this.account = account;
    }

    public int getCode() {
        return code;
    }
    public String getAccount() {
        return account;
    }

    public static MessageActionEnum getByCode(int code) {
        for (MessageActionEnum actionEnum : values()) {
            if (actionEnum.getCode() == code) {
                return actionEnum;
            }
        }
        return null;
    }
    public static MessageActionEnum getByAccount(String account) {
        for (MessageActionEnum actionEnum : values()) {
            if (actionEnum.getAccount().equals(account)) {
                return actionEnum;
            }
        }
        return null;
    }
}
