package com.wecloud.im.ws.enums;

/**
 * @Description ws响应类型
 * @Author xxxname xxxemail.com
 * @Date 2019-12-05
 */
public enum MsgTypeEnum {

    //    xx邀请xx加入会话 -1007
    INVITE_CLIENT_JOIN_CONVERSATION(-1007),

    //    xx被xx移出会话 -1008
    REMOVE_CLIENT_CONVERSATION(-1008),

    //    xx已接收某消息 -1009
    CLIENT_RECEIVED_MSG(-1009),

    //    xx已读某条消息 -1010
    CLIENT_READ_MSG(-1010),

    //    你被xx拉入新会话 -1011
    CLIENT_JOIN_NEW_CONVERSATION(-1011),

    //    主动退出会话 -1012
    LEAVE_CONVERSATION(-1012),


    //    成为新群主 -1013
    CONVERSATION_NEW_CREATOR(-1013),

    ;

    private final int uriCode;

    MsgTypeEnum(int uriCode) {
        this.uriCode = uriCode;
    }

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

    public int getUriCode() {
        return uriCode;
    }
}
