package com.ym.mec.gateway.web.filter;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;

@Component
public class AuthFilter extends ZuulFilter {

	@Override
	public Object run() throws ZuulException {//过滤器核心业务方法
		RequestContext requestContext = RequestContext.getCurrentContext();
		HttpServletRequest request = requestContext.getRequest();


		return null;
	}

	@Override
	public boolean shouldFilter() {// 返回true，必须执行过滤器；false，不执行过滤器
		return true;
	}

	@Override
	public int filterOrder() {// 过滤器的执行顺序，数字越小越先执行
		return 0;
	}

	@Override
	public String filterType() {// 过滤类型，前置过滤器，后置过滤器
		return "pre";
	}

}
