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();
|
}
|
}
|