package com.sf.service.index.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * 功能描述: 应用工具类
 *
 * @author a_kun
 * @date 2024/4/22 15:48
 */
@Slf4j
@Component
public class AppUtils {

    public static String getAppCodeFromRequestHeader(){
        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        HttpServletRequest request = servletRequestAttributes.getRequest();
        return request.getHeader("appCode");
    }


}
