package com.sptg.common.core.feign;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import feign.Logger;
import feign.RequestInterceptor;

@ConditionalOnClass(FeignClient.class)
@Configuration
public class FeignAutoConfiguration {
	@Bean
    public RequestInterceptor gatewayRequestInterceptor() {
        return new GatewayRequestInterceptor();
    }
	@Bean
	public RequestInterceptor charlesRequestInterceptor() {
	    return new CharlesRequestInterceptor();
	}
	@Bean
	public Logger.Level feignLevel() {
        return Logger.Level.FULL;
    }
}
