xiangpei
2024-07-29 77cc9d9195dcde870672ae78ebf1316ede80c7b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.ycl.feign;
 
import com.ycl.interceptor.HKFeignInterceptor;
import feign.RequestInterceptor;
import feign.codec.ErrorDecoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
/**
 *海康接口配置
 */
@Configuration
public class HKFeignConfig {
    /**
     * 注入拦截器
     */
    @Bean
    public RequestInterceptor requestInterceptor(){
        return new HKFeignInterceptor();
    }
 
    /**
     * 调用异常处理
     * @return
     */
    @Bean
    public ErrorDecoder errorDecoder() {
        return new FeignErrorDecoder();
    }
}