chen.lin
4 天以前 a1d1d928893c33fad6694b2503a425ab29af0a15
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");
    }
}