|
|
@@ -3,10 +3,13 @@ package com.ningdatech.pmapi.common.config; |
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature; |
|
|
|
import com.alibaba.fastjson.support.config.FastJsonConfig; |
|
|
|
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; |
|
|
|
import com.ningdatech.pmapi.common.interceptor.LogInterceptor; |
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
import org.springframework.http.MediaType; |
|
|
|
import org.springframework.http.converter.HttpMessageConverter; |
|
|
|
import org.springframework.lang.NonNull; |
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
|
|
|
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
@@ -34,4 +37,9 @@ public class ConfigurerAdapter implements WebMvcConfigurer { |
|
|
|
converter.setDefaultCharset(StandardCharsets.UTF_8); |
|
|
|
converters.add(converter); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void addInterceptors(@NonNull InterceptorRegistry registry) { |
|
|
|
registry.addInterceptor(new LogInterceptor()).addPathPatterns("/**").order(-100); |
|
|
|
} |
|
|
|
} |