package com.game.business.util.im;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author jiang
 */
@Getter
@AllArgsConstructor
public enum GroupChatMsgEnum {

    /**
     * 未知消息
     */
    TYPE_UNKNOWN(-1, "11233"),
    /**
     * 图片
     */
    TYPE_IMAGE(0, "11234"),
    /**
     * GIFT
     */
    TYPE_GIFT(1, "11235"),
    /**
     * 音频
     */
    TYPE_VOICE(2, "11236"),
    /**
     * 视频
     */
    TYPE_VIDEO(3, "11238"),
    /**
     * 一对一语音
     */
    TYPE_CALL_VOICE(4, "11239"),
    /**
     * 一对一视频
     */
    TYPE_CALL_VIDEO(5, "11240"),
    /**
     * 红包样式1
     */
    TYPE_RED_ENVELOPE(6, "11241"),
    /**
     * 寻觅订单
     */
    TYPE_SEEK(7, "11230"),
    /**
     * 文本
     */
    TYPE_TEXT(8, "11242"),
    /**
     * 群组提示性信息
     */
    TYPE_GROUP(9, "11243"),
    /**
     * 购物
     */
    TYPE_SHOP_ORDER(10, "11244"),
    /**
     * 发红包
     */
    SEND_RED_PACKET(1101, "11245"),
    /**
     * 领红包
     */
    OPEN_RED_PACKET(1102, "11246"),
    /**
     * 加入家族
     */
    JOIN_CHAT_FAMILY(1201, "11247"),
    /**
     * 求赏
     */
    ASK_FOR_REWARD(1301, "11248"),

    /**
     * 语音消息检查回复
     */
    voiceMsgCheckCallBack(1001, "11249");

    int code;
    String description;

    public static GroupChatMsgEnum getGroupChatMsgEnum(int code) {
        for (GroupChatMsgEnum chatMsgEnum : GroupChatMsgEnum.values()) {
            if (chatMsgEnum.getCode() == code) {
                return chatMsgEnum;
            }
        }
        return TYPE_UNKNOWN;
    }
}
