properties优化
properties优化
This commit is contained in:
@@ -2,6 +2,8 @@ package org.maxkey;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.maxkey.config.ApplicationConfig;
|
||||
import org.maxkey.web.InitializeContext;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.slf4j.Logger;
|
||||
@@ -50,7 +52,7 @@ public class MaxKeyMgtApplication extends SpringBootServletInitializer {
|
||||
_logger.error("",e);
|
||||
}
|
||||
_logger.info("MaxKeyMgt at "+new Date(applicationContext.getStartupDate()));
|
||||
_logger.info("MaxKeyMgt Server Port "+applicationContext.getBean(MaxKeyMgtConfig.class).getPort());
|
||||
_logger.info("MaxKeyMgt Server Port "+applicationContext.getBean(ApplicationConfig.class).getPort());
|
||||
_logger.info("MaxKeyMgt started.");
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.maxkey;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import org.maxkey.authz.oauth2.provider.client.JdbcClientDetailsService;
|
||||
import org.maxkey.constants.ConstantsProperties;
|
||||
import org.maxkey.crypto.password.opt.impl.TimeBasedOtpAuthn;
|
||||
import org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm;
|
||||
import org.slf4j.Logger;
|
||||
@@ -15,20 +16,11 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:/application.properties")
|
||||
@PropertySource(ConstantsProperties.applicationPropertySource)
|
||||
public class MaxKeyMgtConfig implements InitializingBean {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(MaxKeyMgtConfig.class);
|
||||
|
||||
@Value("${server.port:8080}")
|
||||
private int port;
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
|
||||
@Bean(name = "oauth20JdbcClientDetailsService")
|
||||
public JdbcClientDetailsService JdbcClientDetailsService(
|
||||
|
||||
Reference in New Issue
Block a user