package com.qmth.themis.business.enums;

import java.util.Objects;

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

    TERMINAL_TYPE_WINDOWS("1", "Windows 端"),

    TERMINAL_TYPE_ANDROID("2", "Android 端"),

    TERMINAL_TYPE_IOS("3", "iOS 端"),

    TERMINAL_TYPE_LINUX("4", "Linux 端"),

    TERMINAL_TYPE_OTHER("100", "其他");

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