|
@@ -3,7 +3,6 @@ package com.keao.edu.user.config;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
-import com.keao.edu.datasource.interceptor.DataSourceInterceptor;
|
|
|
|
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
|
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Configuration;
|
|
@@ -14,6 +13,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
import com.keao.edu.common.config.EnumConverterFactory;
|
|
import com.keao.edu.common.config.EnumConverterFactory;
|
|
import com.keao.edu.common.config.LocalFastJsonHttpMessageConverter;
|
|
import com.keao.edu.common.config.LocalFastJsonHttpMessageConverter;
|
|
|
|
+import com.keao.edu.common.tenant.TenantInterceptor;
|
|
|
|
+import com.keao.edu.datasource.interceptor.DataSourceInterceptor;
|
|
|
|
|
|
@Configuration
|
|
@Configuration
|
|
public class WebMvcConfig implements WebMvcConfigurer {
|
|
public class WebMvcConfig implements WebMvcConfigurer {
|
|
@@ -30,12 +31,18 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
|
|
|
|
registry.addInterceptor(getDataSrouceInterceptor()).addPathPatterns("/**");
|
|
registry.addInterceptor(getDataSrouceInterceptor()).addPathPatterns("/**");
|
|
|
|
+ registry.addInterceptor(getTenantInterceptor()).addPathPatterns("/**");
|
|
}
|
|
}
|
|
|
|
|
|
@Bean
|
|
@Bean
|
|
public DataSourceInterceptor getDataSrouceInterceptor() {
|
|
public DataSourceInterceptor getDataSrouceInterceptor() {
|
|
return new DataSourceInterceptor();
|
|
return new DataSourceInterceptor();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Bean
|
|
|
|
+ public TenantInterceptor getTenantInterceptor() {
|
|
|
|
+ return new TenantInterceptor();
|
|
|
|
+ }
|
|
|
|
|
|
@Bean
|
|
@Bean
|
|
public HttpMessageConverters fastJsonHttpMessageConverters(){
|
|
public HttpMessageConverters fastJsonHttpMessageConverters(){
|