package com.wecloud.im.server.enums;

/**
 * @Description ws请求类型
 * @Author hewei hwei1233@163.com
 * @Date 2019-12-05
 */
public enum WsRequestCmdEnum {

    /**
     * 普通聊天
     */
    NORMAL_CHAT(1),

    /**
     * ping
     */
    PING(2),

    /**
     * 单人WebRTC音视频通话
     */
    SINGLE_RTC(3),
    /**
     * 单人WebRTC音视频通话
     */
    THROUSAND_CHAT(4);


    private final int cmdCode;

    WsRequestCmdEnum(int uriCode) {
        this.cmdCode = uriCode;
    }

    /**
     * 根据uriCode获取
     *
     * @param uriCode
     * @return
     */
    public static WsRequestCmdEnum getByCode(int uriCode) {
        for (WsRequestCmdEnum wsRequestUriPathEnum : values()) {
            if (wsRequestUriPathEnum.getCmdCode() == uriCode) {
                return wsRequestUriPathEnum;
            }
        }
        return null;
    }

    public int getCmdCode() {
        return cmdCode;
    }
}
