chen.lin
2 天以前 9140aee230de0ef41de9682a9353fbd372e2bcaa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.vincent.rsf.openApi.config;
 
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
/**
 * Feign 请求配置,与原有 RestTemplate 转发保持一致的请求头
 */
@Configuration
public class FeignConfig {
 
    @Bean
    public RequestInterceptor wmsApiVersionInterceptor() {
        return (RequestTemplate template) -> template.header("api-version", "v2.0");
    }
}