package com.m2pool.chat.utils;

import java.util.ArrayList;
import java.util.Map;

/**
 * @ClassName StompUtils
 * @Description stomp工具类
 * @Author yyb
 * @Date 2025/4/29 11:35
 */
public class StompUtils {
    /**
     * 获取stomp自定义请求头
     * @param raw
     * @param headerKey
     * @return
     */
    public static String getConnectCustomHeaders(Object raw,String headerKey){
        String headerValue = "";
        if (raw instanceof Map) {
            Object value = ((Map<?, ?>) raw).get(headerKey);
            if(value instanceof ArrayList){
                headerValue = ((ArrayList<?>) value).get(0).toString();
            }
        }
        return headerValue;
    }

}
