提交 dfecbff9 编写于 作者: misaka's avatar misaka

zuul转发header信息

上级 65b5b408
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<#if sys.getSaaSMode()==4>
package ${pub.getPKGCodeName()}.${app.getPKGCodeName()?lower_case}.config;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class ${app.getPKGCodeName()}HeaderFilter extends ZuulFilter {
@Override
public String filterType() {
return "pre";
}
@Override
public int filterOrder() {
return 0;
}
@Override
public boolean shouldFilter() {
return true;
}
@Override
public Object run() throws ZuulException {
RequestContext ctx = RequestContext.getCurrentContext();
ctx.addZuulRequestHeader("srfsystem", "${sys.getCodeName()}");
return null;
}
}
</#if>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册