You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.6 KiB
53 lines
1.6 KiB
package org.ros.chatto;
|
|
|
|
import org.modelmapper.ModelMapper;
|
|
import org.ros.chatto.security.AuthenticationSuccessHandlerImpl;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.context.MessageSource;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.PropertySource;
|
|
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
|
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
|
|
|
@PropertySource(value = "classpath:queries.properties")
|
|
@Configuration
|
|
public class BeanConfigurations {
|
|
@Value("${spring.datasource.url}")
|
|
private String url;
|
|
|
|
@Value("${spring.datasource.username}")
|
|
private String userName;
|
|
|
|
@Value("${spring.datasource.password}")
|
|
private String password;
|
|
|
|
|
|
@Bean
|
|
public AuthenticationSuccessHandler authenticationSuccessHandler() {
|
|
return new AuthenticationSuccessHandlerImpl();
|
|
}
|
|
|
|
@Bean
|
|
public ModelMapper modelMapper() {
|
|
ModelMapper modelMapper = new ModelMapper();
|
|
return modelMapper;
|
|
}
|
|
|
|
@Bean
|
|
public MessageSource messageSource() {
|
|
final ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
|
|
messageSource.setBasenames("classpath:/messages,file:./config/messages");
|
|
messageSource.setUseCodeAsDefaultMessage(true);
|
|
messageSource.setDefaultEncoding("UTF-8");
|
|
messageSource.setCacheSeconds(5);
|
|
return messageSource;
|
|
}
|
|
|
|
// @Bean
|
|
// public Connection connection() throws SQLException
|
|
// {
|
|
// return DriverManager.getConnection(url, userName, password);
|
|
// }
|
|
|
|
}
|