17 lines
537 B
Java
17 lines
537 B
Java
package com.youlai.system.config;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
@Configuration
|
|
public class JacksonConfig {
|
|
|
|
@Bean
|
|
public ObjectMapper objectMapper() {
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
objectMapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
|
|
return objectMapper;
|
|
}
|
|
} |