package com.qmth.themis.business.enums;

import java.util.Objects;

/**
 * @Description: 腾讯云事件回调组
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/4/27
 */
public enum TencentEventGroupEnum {

    EVENT_GROUP_ROOM("1", "房间事件组"),

    EVENT_GROUP_MEDIA("2", "媒体事件组");

    private TencentEventGroupEnum(String code, String title) {
        this.code = code;
        this.title = title;
    }

    private String code;

    private String title;

    public String getCode() {
        return code;
    }

    public String getTitle() {
        return title;
    }

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