|
@@ -1,5 +1,6 @@
|
|
|
package com.qqflow.engine.config;
|
|
package com.qqflow.engine.config;
|
|
|
|
|
|
|
|
|
|
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
|
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
|
|
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
|
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Bean;
|
|
@@ -12,10 +13,13 @@ import java.time.format.DateTimeFormatter;
|
|
|
@Configuration
|
|
@Configuration
|
|
|
public class WebConfig implements WebMvcConfigurer {
|
|
public class WebConfig implements WebMvcConfigurer {
|
|
|
|
|
|
|
|
|
|
+ private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+
|
|
|
@Bean
|
|
@Bean
|
|
|
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
|
|
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
|
|
|
- return builder -> builder.serializers(
|
|
|
|
|
- new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
|
|
|
+ return builder -> builder
|
|
|
|
|
+ .serializers(new LocalDateTimeSerializer(DATE_TIME_FORMATTER))
|
|
|
|
|
+ .deserializers(new LocalDateTimeDeserializer(DATE_TIME_FORMATTER));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|