package com.cool.store.enums;


import com.cool.store.utils.CommonContextUtil;

/**
 * @author zhangchenbiao
 * @FileName: RocketMqTagEnum
 * @Description:
 * @date 2021-12-23 16:14
 */
public enum RocketMqTagEnum {

    AUTH_SCOPE_CHANGE("auth_scope_change","授权范围变更"),
    USER_EVENT("user_event","钉钉通讯录变更事件"),
    DEPT_EVENT("dept_event","部门事件"),
    STORE_DING_QUEUE("store_ding_queue", "微应用钉钉消息发送"),
    ;


    private final String tag;

    private final String remark;

    RocketMqTagEnum(String tag, String remark) {
        this.tag = tag;
        this.remark = remark;
    }

    public String getDefaultTag() {
        return tag;
    }

    public String getTag() {
        return tag + "_" + CommonContextUtil.getProfileName();
    }

    public String getRemark() {
        return remark;
    }

    public static RocketMqTagEnum getByTag(String tag){
        for (RocketMqTagEnum value : values()) {
            if(value.getTag().equals(tag)){
                return value;
            }
        }
        return null;
    }
}
