设置主要的json解析器,以及添加监控器的文档依赖

This commit is contained in:
wangkang
2017-07-29 10:18:34 +08:00
parent 6aec8a415c
commit a3a5376118
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -33,6 +33,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- spring-boot-actuator-docs -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-docs</artifactId>
</dependency>
<!-- springboot configuration-processor -->
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -10,6 +10,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.client.RestTemplate;
@@ -37,6 +38,7 @@ public class BaseApplication {
* @return xssObjectMapper
*/
@Bean
@Primary
public ObjectMapper xssObjectMapper(Jackson2ObjectMapperBuilder builder) {
//解析器
ObjectMapper objectMapper = builder.createXmlMapper(false).build();