使用HttpMessageConverters解决精度损失问题导致Feign不能通信
程序员文章站
2022-07-15 12:58:57
...
使用HttpMessageConverters解决精度损失问题导致Feign不能通信
@Bean
public HttpMessageConverters fastJsonHttpMessageConverters() {
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
FastJsonConfig fastJsonConfig = new FastJsonConfig();
fastJsonConfig.setSerializerFeatures(SerializerFeature.WriteMapNullValue);
SerializeConfig config = new SerializeConfig();
config.put(Long.class, new LongObjectSerializer());
fastJsonConfig.setSerializeConfig(config);
fastConverter.setFastJsonConfig(fastJsonConfig);
return new HttpMessageConverters(fastConverter);
}
解决方法待定。。。