进一步优化 json 工具类,默认使用 Spring 初始化出来的
parent
eadc4f749a
commit
fa3f382210
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.dashboard.framework.jackson.config;
|
||||||
|
|
||||||
|
import cn.iocoder.dashboard.util.json.JsonUtils;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JacksonConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@SuppressWarnings("InstantiationOfUtilityClass")
|
||||||
|
public JsonUtils jsonUtils(ObjectMapper objectMapper) {
|
||||||
|
JsonUtils.init(objectMapper);
|
||||||
|
return new JsonUtils();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue