|
@@ -12,6 +12,7 @@ import com.api.converter.CustomMessageConverter;
|
12
|
12
|
import com.api.form.ChildConvertForm;
|
13
|
13
|
import com.common.interceptor.AuthorizationInterceptor;
|
14
|
14
|
import com.api.resolver.LoginUserHandlerMethodArgumentResolver;
|
|
15
|
+import com.common.interceptor.TestInterceptor;
|
15
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
16
|
17
|
import org.springframework.context.annotation.Configuration;
|
17
|
18
|
import org.springframework.core.convert.converter.Converter;
|
|
@@ -46,6 +47,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
46
|
47
|
@Override
|
47
|
48
|
public void addInterceptors(InterceptorRegistry registry) {
|
48
|
49
|
registry.addInterceptor(authorizationInterceptor).addPathPatterns("/api/**");
|
|
50
|
+ registry.addInterceptor(new TestInterceptor()).addPathPatterns("/interceptor/**");
|
49
|
51
|
}
|
50
|
52
|
|
51
|
53
|
@Override
|
|
@@ -90,6 +92,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
90
|
92
|
stringMediaTypeHashMap.put("zxy",MediaType.parseMediaType("application/x-zxy"));
|
91
|
93
|
ParameterContentNegotiationStrategy parameterContentNegotiationStrategy =
|
92
|
94
|
new ParameterContentNegotiationStrategy(stringMediaTypeHashMap);
|
|
95
|
+ parameterContentNegotiationStrategy.setParameterName("dataFormat");
|
93
|
96
|
configurer.strategies(Arrays.asList(parameterContentNegotiationStrategy));
|
94
|
97
|
}
|
95
|
98
|
}
|