package com.qmth.themis.business.enums;

import java.util.Objects;

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

    USER_TYPE_WEBRTC("1", "webrtc"),

    USER_TYPE_APPLET("2", "小程序"),

    USER_TYPE_NATIVE_SDK("3", "Native SDK");

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