|
@@ -1,6 +1,9 @@
|
|
|
package com.zksy;
|
|
package com.zksy;
|
|
|
|
|
|
|
|
-import org.mybatis.spring.annotation.MapperScan;
|
|
|
|
|
|
|
+import com.zksy.server.WebSocketServer;
|
|
|
|
|
+import com.zksy.service.ChatService;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
@@ -11,12 +14,24 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
|
* @author zksy
|
|
* @author zksy
|
|
|
*/
|
|
*/
|
|
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
|
|
-public class ZksyApplication
|
|
|
|
|
-{
|
|
|
|
|
- public static void main(String[] args)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+public class ZksyApplication implements CommandLineRunner {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ChatService chatService;
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
|
|
SpringApplication.run(ZksyApplication.class, args);
|
|
SpringApplication.run(ZksyApplication.class, args);
|
|
|
System.out.println("中科盛阳管理平台启动成功");
|
|
System.out.println("中科盛阳管理平台启动成功");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void run(String... args) throws Exception {
|
|
|
|
|
+ new Thread(() -> {
|
|
|
|
|
+ try {
|
|
|
|
|
+ new WebSocketServer(8081, chatService).start();
|
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }).start();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|