websocket练习

2019-04-18  本文已影响0人  明天也是奋斗鸭

1.首先新建模块:

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>

2.建立config、controller包:

image

3.WebSocketConfig、WebSocketServer、WebSocketController:

4.接下来主方法WebsocketApplication

5.运行Swagger查看结果

上一篇下一篇

猜你喜欢

热点阅读