|
|
@@ -28,15 +28,15 @@ public class ConfigurerAdapter implements WebMvcConfigurer { |
|
|
|
@Override |
|
|
|
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { |
|
|
|
// 使用 fastjson 序列化,会导致 @JsonIgnore 失效,可以使用 @JSONField(serialize = false) 替换 |
|
|
|
// FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); |
|
|
|
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); |
|
|
|
List<MediaType> supportMediaTypeList = new ArrayList<>(); |
|
|
|
supportMediaTypeList.add(MediaType.APPLICATION_JSON); |
|
|
|
FastJsonConfig config = new FastJsonConfig(); |
|
|
|
config.setDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect); |
|
|
|
// converter.setFastJsonConfig(config); |
|
|
|
// converter.setSupportedMediaTypes(supportMediaTypeList); |
|
|
|
// converter.setDefaultCharset(StandardCharsets.UTF_8); |
|
|
|
// converters.add(converter); |
|
|
|
converter.setFastJsonConfig(config); |
|
|
|
converter.setSupportedMediaTypes(supportMediaTypeList); |
|
|
|
converter.setDefaultCharset(StandardCharsets.UTF_8); |
|
|
|
converters.add(converter); |
|
|
|
} |
|
|
|
} |