package com.hotent.base.conf;

import feign.codec.Decoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.context.annotation.Bean;

public class DecryptingFeignConfig {
    @Value("${securityfilter.enabled:false}")
    protected boolean securityEnabled;

    // 替换默认的 Decoder
    @Bean
    public Decoder feignDecoder(ObjectFactory<HttpMessageConverters> converters) {
        return new DecryptingDecoder(securityEnabled, converters);
    }
}