|
|
@@ -12,6 +12,7 @@ import org.springframework.context.annotation.Configuration; |
|
|
import org.springframework.http.converter.HttpMessageConverter; |
|
|
import org.springframework.http.converter.HttpMessageConverter; |
|
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; |
|
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; |
|
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver; |
|
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver; |
|
|
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
|
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|
|
@@ -29,6 +30,7 @@ import java.util.List; |
|
|
* @date 2017-04-20 22:30 |
|
|
* @date 2017-04-20 22:30 |
|
|
*/ |
|
|
*/ |
|
|
@Configuration |
|
|
@Configuration |
|
|
|
|
|
@EnableWebMvc |
|
|
public class WebMvcConfig implements WebMvcConfigurer { |
|
|
public class WebMvcConfig implements WebMvcConfigurer { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private AuthorizationInterceptor authorizationInterceptor; |
|
|
private AuthorizationInterceptor authorizationInterceptor; |
|
|
@@ -68,11 +70,11 @@ public class WebMvcConfig implements WebMvcConfigurer { |
|
|
.without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) |
|
|
.without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) |
|
|
); |
|
|
); |
|
|
//序列化将Long转String类型 |
|
|
//序列化将Long转String类型 |
|
|
simpleModule.addSerializer(Long.class, com.fasterxml.jackson.databind.ser.std.ToStringSerializer.instance); |
|
|
|
|
|
simpleModule.addSerializer(Long.TYPE, com.fasterxml.jackson.databind.ser.std.ToStringSerializer.instance); |
|
|
|
|
|
|
|
|
simpleModule.addSerializer(Long.class, ToStringSerializer.instance); |
|
|
|
|
|
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); |
|
|
SimpleModule bigIntegerModule = new SimpleModule(); |
|
|
SimpleModule bigIntegerModule = new SimpleModule(); |
|
|
//序列化将BigInteger转String类型 |
|
|
//序列化将BigInteger转String类型 |
|
|
bigIntegerModule.addSerializer(BigInteger.class, com.fasterxml.jackson.databind.ser.std.ToStringSerializer.instance); |
|
|
|
|
|
|
|
|
bigIntegerModule.addSerializer(BigInteger.class, ToStringSerializer.instance); |
|
|
SimpleModule bigDecimalModule = new SimpleModule(); |
|
|
SimpleModule bigDecimalModule = new SimpleModule(); |
|
|
//序列化将BigDecimal转String类型 |
|
|
//序列化将BigDecimal转String类型 |
|
|
bigDecimalModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); |
|
|
bigDecimalModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); |
|
|
|