config: config set

main
minuk926 2 years ago
parent f9e5cb2005
commit 5c433c537f

@ -1,8 +1,10 @@
package com.xit.core.config; package com.xit.core.config;
import com.xit.core.constant.XitConstants; import com.xit.core.constant.XitConstants;
import com.xit.core.oauth2.config.properties.CorsProperties;
import com.xit.core.oauth2.oauth.AuthInterceptor; import com.xit.core.oauth2.oauth.AuthInterceptor;
import com.xit.core.support.RestTemplateLoggingRequestInterceptor; import com.xit.core.support.RestTemplateLoggingRequestInterceptor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -51,8 +53,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Configuration @Configuration
@EnableSpringDataWebSupport @EnableSpringDataWebSupport
//@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class}) @RequiredArgsConstructor
//@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcConfigurer { public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcConfigurer {
private static final String[] EXCLUDE_LOCALE_CHANGE_LIST = { private static final String[] EXCLUDE_LOCALE_CHANGE_LIST = {
"/resources/**", "/resources/**",
@ -74,6 +75,8 @@ public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcCon
@Value("${xit.locale}") @Value("${xit.locale}")
private String locale; private String locale;
private final CorsProperties corsProperties;
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Locale Resolver Setting : Cookie // Locale Resolver Setting : Cookie
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -168,22 +171,22 @@ public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcCon
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// /** /**
// * CORS 설정 * CORS
// * TODO :: SecurityConfig#corsConfigurationSource 설정이 안돼는 경우 적용 * TODO :: SecurityConfig#corsConfigurationSource
// * @param registry CorsRegistry * @param registry CorsRegistry
// * *
// * @see SecurityConfig#corsConfigurationSource() * @see SecurityConfig#corsConfigurationSource()
// */ */
// @Override @Override
// public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
// registry.addMapping("/**") registry.addMapping("/**")
// .allowedOrigins("") .allowedOrigins(corsProperties.getAllowedOrigins())
// .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") .allowedMethods(corsProperties.getAllowedMethods())
// .allowedHeaders("*") .allowedHeaders(corsProperties.getAllowedHeaders())
// .allowCredentials(true) .allowCredentials(true)
// .maxAge(3600); .maxAge(3600);
// } }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// yaml type Message loading // yaml type Message loading

Loading…
Cancel
Save