Removing ArtikusApplication

This commit is contained in:
Artur 2024-10-10 16:01:13 +02:00
parent bec9db923e
commit df1de1d759
1 changed files with 0 additions and 76 deletions

View File

@ -1,76 +0,0 @@
package tk.artikus;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.servlet.theme.ThemeChangeInterceptor;
@SpringBootApplication
@EnableScheduling
@EnableAsync
@ComponentScan("tk.artikus.assets.services")
public class ArtikusApplication implements WebMvcConfigurer {
@Autowired
Environment env;
private static final Locale DEFAULT_LOCALE = new Locale( "pl" ); // Locale.ENGLISH
public static void main( String[] args ) {
SpringApplication.run( ArtikusApplication.class, args );
}
@Override
public void addInterceptors( InterceptorRegistry registry ) {
ThemeChangeInterceptor themeChangeInterceptor = new ThemeChangeInterceptor();
themeChangeInterceptor.setParamName( "theme" );
registry.addInterceptor( themeChangeInterceptor );
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName( "lang" );
registry.addInterceptor( localeChangeInterceptor );
}
@Bean
LocaleResolver localeResolver() {
SessionLocaleResolver slr = new SessionLocaleResolver();
slr.setDefaultLocale(DEFAULT_LOCALE);
return slr;
}
/*
@Bean
WebServerFactoryCustomizer<TomcatServletWebServerFactory> cookieProcessorCustomizer() {
return ( factory ) -> factory.addContextCustomizers(
( context ) -> context.setCookieProcessor(new org.apache.tomcat.util.http.LegacyCookieProcessor()));
}
@Bean
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.INTERFACES)
AssetsDB assetsDB() {
return new SessionAssetsDB();
}
*/
@Bean
RestTemplate restTemplate( ) {
return new RestTemplate();
}
}