package com.qmth.teachcloud.common.enums;

import java.util.Objects;

/**
 * @Description: mq topic enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/7/28
 */
public enum MqTagEnum {

    PDF("创建pdf标签", "pdf", "normal", 0);

    private MqTagEnum(String desc, String code, String type, int id) {
        this.desc = desc;
        this.code = code;
        this.type = type;
        this.id = id;
    }

    private String code;//留痕描述

    private String desc;//标签

    private String type;//消息类型，normal：正常消息，delay：延时消息，transactional：事务消息，broadcast：广播消息

    private int id;

    /**
     * 状态转换 toName
     *
     * @param value
     * @return
     */
    public static String convertToName(String value) {
        for (MqTagEnum e : MqTagEnum.values()) {
            if (Objects.equals(value.trim(), e.getCode())) {
                return e.name();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getType() {
        return type;
    }

    public int getId() {
        return id;
    }
}