socket
This commit is contained in:
@@ -3,9 +3,11 @@ package com.sqx;
|
|||||||
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.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||||
|
|
||||||
|
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
|
@EnableWebSocket
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class SqxApplication {
|
public class SqxApplication {
|
||||||
|
|
||||||
@@ -21,4 +23,4 @@ public class SqxApplication {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
|||||||
* websocket的配置
|
* websocket的配置
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class WebSocketStompConfig{
|
public class WebSocketStompConfig {
|
||||||
//这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint
|
//这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint
|
||||||
@Bean
|
@Bean
|
||||||
public ServerEndpointExporter serverEndpointExporter()
|
public ServerEndpointExporter serverEndpointExporter()
|
||||||
|
|||||||
Reference in New Issue
Block a user