package com.qmth.themis.business.enums;

import java.util.Objects;

/**
 * @Description: 腾讯云事件回调角色类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/4/27
 */
public enum TencentEventRoleTypeEnum {

    MEMBER_TRTC_ANCHOR("20", "主播"),

    MEMBER_TRTC_VIEWER("21", "观众");

    private TencentEventRoleTypeEnum(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 TencentEventRoleTypeEnum convertToName(String code) {
        for (TencentEventRoleTypeEnum e : TencentEventRoleTypeEnum.values()) {
            if (Objects.equals(code, e.name())) {
                return e;
            }
        }
        return null;
    }
}
