add: fastjson验证
This commit is contained in:
parent
f0a9384e04
commit
f1de578bc5
|
@ -1,28 +1,35 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.com.chinarecrm</groupId>
|
||||
<artifactId>rop</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</parent>
|
||||
<artifactId>rop-demo</artifactId>
|
||||
<name>rop-demo</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.com.chinarecrm</groupId>
|
||||
<artifactId>rop-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.com.chinarecrm</groupId>
|
||||
<artifactId>rop-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.com.chinarecrm</groupId>
|
||||
<artifactId>rop</artifactId>
|
||||
<version>2.2.0.RELEASE</version>
|
||||
</parent>
|
||||
<artifactId>rop-demo</artifactId>
|
||||
<name>rop-demo</name>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.com.chinarecrm</groupId>
|
||||
<artifactId>rop-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.com.chinarecrm</groupId>
|
||||
<artifactId>rop-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.51</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,7 +1,14 @@
|
|||
package cn.com.chinarecrm.rop;
|
||||
|
||||
import org.nutz.lang.Lang;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ROPDemoApplication {
|
||||
|
@ -10,4 +17,14 @@ public class ROPDemoApplication {
|
|||
SpringApplication.run(ROPDemoApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FastJsonHttpMessageConverter fastJsonHttpMessageConverters() {
|
||||
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
|
||||
FastJsonConfig fastJsonConfig = new FastJsonConfig();
|
||||
fastJsonConfig.setSerializerFeatures(SerializerFeature.PrettyFormat);
|
||||
fastConverter.setFastJsonConfig(fastJsonConfig);
|
||||
fastConverter.setSupportedMediaTypes(Lang.list(MediaType.APPLICATION_JSON));
|
||||
return fastConverter;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue