mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-16 05:20:42 +08:00
v 1.5.0 RC2
v 1.5.0 RC2
This commit is contained in:
@@ -3,6 +3,7 @@ package org.maxkey;
|
||||
import java.util.Date;
|
||||
import javax.servlet.ServletException;
|
||||
import org.maxkey.web.InitializeContext;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -16,9 +17,22 @@ import org.springframework.context.annotation.ImportResource;
|
||||
@SpringBootApplication
|
||||
@ImportResource(locations={"classpath:spring/maxkey-mgt.xml"})
|
||||
@ComponentScan(basePackages = {
|
||||
"org.maxkey.MaxKeyMgtConfig"
|
||||
"org.maxkey.MaxKeyMgtConfig",
|
||||
"org.maxkey.config",
|
||||
"org.maxkey.domain",
|
||||
"org.maxkey.domain.apps",
|
||||
"org.maxkey.domain.userinfo",
|
||||
"org.maxkey.web.endpoint",
|
||||
"org.maxkey.web.contorller",
|
||||
"org.maxkey.web.apps.contorller",
|
||||
"org.maxkey.web.endpoint",
|
||||
"org.maxkey.authn",
|
||||
"org.maxkey.dao",
|
||||
"org.maxkey.web",
|
||||
"org.maxkey.web.tag"
|
||||
}
|
||||
)
|
||||
@MapperScan("org.maxkey.dao.persistence,")
|
||||
public class MaxKeyMgtApplication extends SpringBootServletInitializer {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(MaxKeyMgtApplication.class);
|
||||
|
||||
@@ -28,7 +42,6 @@ public class MaxKeyMgtApplication extends SpringBootServletInitializer {
|
||||
ConfigurableApplicationContext applicationContext =SpringApplication.run(MaxKeyMgtApplication.class, args);
|
||||
InitializeContext initWebContext=new InitializeContext(applicationContext);
|
||||
|
||||
|
||||
try {
|
||||
initWebContext.init(null);
|
||||
} catch (ServletException e) {
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package org.maxkey;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import javax.sql.DataSource;
|
||||
import org.maxkey.authz.oauth2.provider.client.JdbcClientDetailsService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
@Configuration
|
||||
@PropertySource("classpath:/application.properties")
|
||||
@MapperScan("org.maxkey.dao.persistence,")
|
||||
public class MaxKeyMgtConfig {
|
||||
public class MaxKeyMgtConfig implements InitializingBean {
|
||||
private static final Logger _logger = LoggerFactory.getLogger(MaxKeyMgtConfig.class);
|
||||
|
||||
@Value("${server.port:8080}")
|
||||
@@ -23,5 +26,19 @@ public class MaxKeyMgtConfig {
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
@Bean(name = "oauth20JdbcClientDetailsService")
|
||||
public JdbcClientDetailsService JdbcClientDetailsService(
|
||||
DataSource dataSource,PasswordEncoder passwordReciprocal) {
|
||||
JdbcClientDetailsService clientDetailsService = new JdbcClientDetailsService(dataSource);
|
||||
clientDetailsService.setPasswordEncoder(passwordReciprocal);
|
||||
return clientDetailsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user