|
@@ -1,38 +0,0 @@
|
|
|
-//package com.backendsys.config.Mybatis;
|
|
|
-//
|
|
|
-//import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-//import com.fasterxml.jackson.databind.SerializationFeature;
|
|
|
-//import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
|
-//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-//import org.springframework.context.annotation.Configuration;
|
|
|
-//import org.springframework.http.converter.HttpMessageConverter;
|
|
|
-//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
|
|
-//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
-//
|
|
|
-//import javax.annotation.PostConstruct;
|
|
|
-//import java.util.List;
|
|
|
-//
|
|
|
-//@Configuration
|
|
|
-//public class JacksonConfig implements WebMvcConfigurer {
|
|
|
-//
|
|
|
-// @Autowired
|
|
|
-// private ObjectMapper objectMapper;
|
|
|
-//
|
|
|
-// @PostConstruct
|
|
|
-// public void init() {
|
|
|
-// // 强制注册 JavaTimeModule
|
|
|
-// objectMapper.registerModule(new JavaTimeModule());
|
|
|
-// // 禁用时间戳格式
|
|
|
-// objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
|
|
-//
|
|
|
-// System.out.println("强制注册后的模块: " + objectMapper.getRegisteredModuleIds());
|
|
|
-// }
|
|
|
-//
|
|
|
-// @Override
|
|
|
-// public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
|
|
-// // 确保使用配置后的 ObjectMapper
|
|
|
-// converters.stream()
|
|
|
-// .filter(converter -> converter instanceof MappingJackson2HttpMessageConverter)
|
|
|
-// .forEach(converter -> ((MappingJackson2HttpMessageConverter) converter).setObjectMapper(objectMapper));
|
|
|
-// }
|
|
|
-//}
|