Browse Source

fix EnableAutoConfiguration

deason 4 years ago
parent
commit
a78015788d
1 changed files with 36 additions and 39 deletions
  1. 36 39
      src/main/java/cn/com/qmth/examcloud/ws/WebSocketApp.java

+ 36 - 39
src/main/java/cn/com/qmth/examcloud/ws/WebSocketApp.java

@@ -1,52 +1,49 @@
 package cn.com.qmth.examcloud.ws;
 
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
+import cn.com.qmth.examcloud.web.support.SpringContextHolder;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 
-import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-
-@SpringBootApplication
 @Configuration
 @EnableDiscoveryClient
 @ComponentScan(basePackages = {"cn.com.qmth"})
-@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
 public class WebSocketApp {
 
-	static {
-		String runtimeLevel = System.getProperty("log.commonLevel");
-		if (null == runtimeLevel) {
-			System.setProperty("log.commonLevel", "INFO");
-		}
-
-	}
-
-	/**
-	 * main
-	 *
-	 * @author WANGWEI
-	 * @param args
-	 * @throws Exception
-	 */
-	public static void main(String[] args) throws Exception {
-
-		AppBootstrap.run(WebSocketApp.class, args);
-
-		test();
-	}
-
-	/**
-	 * 测试方法
-	 *
-	 * @author WANGWEI
-	 */
-	private static void test() {
-		Tester tester = SpringContextHolder.getBean(Tester.class);
-		tester.test();
-	}
-
-}
+    static {
+        String runtimeLevel = System.getProperty("log.commonLevel");
+        if (null == runtimeLevel) {
+            System.setProperty("log.commonLevel", "INFO");
+        }
+
+    }
+
+    /**
+     * main
+     *
+     * @param args
+     * @throws Exception
+     * @author WANGWEI
+     */
+    public static void main(String[] args) throws Exception {
+
+        AppBootstrap.run(WebSocketApp.class, args);
+
+        test();
+    }
+
+    /**
+     * 测试方法
+     *
+     * @author WANGWEI
+     */
+    private static void test() {
+        Tester tester = SpringContextHolder.getBean(Tester.class);
+        tester.test();
+    }
+
+}