package com.rrtx.services.common.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;


/**
 * ClassName: HttpContextUtil<br>
 * Description: HttpContextUtil <br>
 * Company: rrtx
 *
 * @author rrtx
 * @version v1.0.0    2019/7/24 5:06 PM  xugz    文件初始创建
 */
public class HttpContextUtil {

	private HttpContextUtil() {

	}

	public static HttpServletRequest getHttpServletRequest() {
		return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
	}
}
