This commit is contained in:
zhouhao
2017-03-23 11:55:14 +08:00
parent 5199f6facd
commit e1e2c7ac3a
25 changed files with 42 additions and 31 deletions

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-bean</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-web-concurrent</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-concurrent-cache</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-web-concurrent</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-concurrent-lock</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-controller</artifactId>

View File

@@ -1,7 +1,9 @@
package org.hsweb.web.controller;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.hsweb.web.bean.po.user.User;
import org.hsweb.web.core.message.FastJsonHttpMessageConverter;
import org.hsweb.web.core.message.ResponseMessage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
@@ -16,11 +18,20 @@ public class MessageConverterConfiguration {
public HttpMessageConverter<Object> converter() {
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
converter.setFeatures(
SerializerFeature.WriteNullListAsEmpty,
SerializerFeature.WriteNullNumberAsZero,
SerializerFeature.WriteNullBooleanAsFalse,
SerializerFeature.WriteDateUseDateFormat
);
return converter;
SerializerFeature.WriteNullListAsEmpty,
SerializerFeature.WriteNullNumberAsZero,
SerializerFeature.WriteNullBooleanAsFalse,
SerializerFeature.WriteDateUseDateFormat
);
return converter;
}
public static void main(String[] args) {
User user = new User();
user.setPassword("test");
user.setUsername("test1");
ResponseMessage message = ResponseMessage.created(user)
.exclude("password");
System.out.println(new FastJsonHttpMessageConverter().converter(message));
}
}

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-core</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-web-dao</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-dao-api</artifactId>

View File

@@ -10,7 +10,7 @@
<dependency>
<groupId>org.hsweb</groupId>
<artifactId>hsweb-web-dao-mybatis</artifactId>
<version>2.2</version>
<version>2.2.1</version>
</dependency>
```

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-web-dao</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-dao-mybatis</artifactId>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-web-oauth2</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-web-oauth2</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-web-oauth2</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-web-oauth2</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-web-oauth2</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-web-service</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hsweb-web-service-api</artifactId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-web-service</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -45,7 +45,7 @@
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
<version>2.2.1</version>
<scope>test</scope>
</dependency>

View File

@@ -21,7 +21,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>hsweb-framework</artifactId>
<groupId>org.hsweb</groupId>
<version>2.2</version>
<version>2.2.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -6,7 +6,7 @@
<groupId>org.hsweb</groupId>
<artifactId>hsweb-framework</artifactId>
<packaging>pom</packaging>
<version>2.2</version>
<version>2.2.1</version>
<name>${project.groupId}:${project.artifactId}</name>
<url>http://www.hsweb.me</url>