Reset by spring-boot 1.5.9
parent
26fcb4058f
commit
5d6bea4dc9
|
@ -0,0 +1,18 @@
|
|||
package com.monkeyk.sos;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
||||
/**
|
||||
* 2017-12-05
|
||||
*
|
||||
* @author Shengzhao Li
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class SpringOauthServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringOauthServerApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.monkeyk.sos;
|
||||
|
||||
import com.monkeyk.sos.web.WebUtils;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.support.SpringBootServletInitializer;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
/**
|
||||
* 2017-12-05
|
||||
*
|
||||
* @author Shengzhao Li
|
||||
*/
|
||||
public class SpringOauthServerServletInitializer extends SpringBootServletInitializer {
|
||||
|
||||
|
||||
@Override
|
||||
public void onStartup(ServletContext servletContext) throws ServletException {
|
||||
super.onStartup(servletContext);
|
||||
|
||||
servletContext.setAttribute("sosVersion", WebUtils.VERSION);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(SpringOauthServerApplication.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ import javax.sql.DataSource;
|
|||
*/
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = "com.monkeyk.sos")
|
||||
@PropertySource(value = {"classpath:spring-oauth-server.properties"})
|
||||
//@PropertySource(value = {"classpath:spring-oauth-server.properties"})
|
||||
@EnableTransactionManagement()
|
||||
public class ContextConfigurer {
|
||||
|
||||
|
|
|
@ -10,6 +10,12 @@ import javax.servlet.http.HttpServletRequest;
|
|||
public abstract class WebUtils {
|
||||
|
||||
|
||||
/**
|
||||
* Sync by pom.xml <version></version>
|
||||
*/
|
||||
public static final String VERSION = "2.0.0";
|
||||
|
||||
|
||||
private static ThreadLocal<String> ipThreadLocal = new ThreadLocal<>();
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
#
|
||||
spring.application.name=spring-oauth-server
|
||||
#
|
||||
# MySQL
|
||||
#####################
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/oauth2?autoReconnect=true&autoReconnectForPools=true&useUnicode=true&characterEncoding=utf8
|
||||
spring.datasource.data-username=andaily
|
||||
spring.datasource.data-password=andaily
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.monkeyk.sos;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class SpringOauthServerApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue