正在显示
4 个修改的文件
包含
7 行增加
和
7 行删除
@@ -23,4 +23,4 @@ | @@ -23,4 +23,4 @@ | ||
23 | * 集成lombok,简化部分代码录入,比如实体类,方便实体及表结构修改,敏捷开发必用,使用方法见[lombok集成使用说明](https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html) | 23 | * 集成lombok,简化部分代码录入,比如实体类,方便实体及表结构修改,敏捷开发必用,使用方法见[lombok集成使用说明](https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html) |
24 | ) | 24 | ) |
25 | * 集成了单文件、多文件上传接口 | 25 | * 集成了单文件、多文件上传接口 |
26 | -* 集成了swagger2,开发环境开启此POM配置,生产环境记得去掉。包冲突问题看POM配置文件。 | ||
26 | +* 集成了swagger2,开发环境开启此POM配置,生产环境记得去掉。包冲突问题看POM配置文件。[接口访问测试地址](http://localhost:7003/swagger-ui.html) |
@@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
5 | import org.springframework.web.bind.annotation.ResponseBody; | 5 | import org.springframework.web.bind.annotation.ResponseBody; |
6 | 6 | ||
7 | @Controller | 7 | @Controller |
8 | -public class ImfLog { | 8 | +public class ImfLogController { |
9 | 9 | ||
10 | 10 | ||
11 | @RequestMapping("/log/imf") | 11 | @RequestMapping("/log/imf") |
@@ -15,7 +15,7 @@ import java.util.concurrent.CopyOnWriteArraySet; | @@ -15,7 +15,7 @@ import java.util.concurrent.CopyOnWriteArraySet; | ||
15 | 15 | ||
16 | @ServerEndpoint(value = "/log") | 16 | @ServerEndpoint(value = "/log") |
17 | @Component | 17 | @Component |
18 | -public class Log { | 18 | +public class LogWebsockController { |
19 | private Process process; | 19 | private Process process; |
20 | private InputStream inputStream; | 20 | private InputStream inputStream; |
21 | //与某个客户端的连接会话,需要通过它来给客户端发送数据 | 21 | //与某个客户端的连接会话,需要通过它来给客户端发送数据 |
@@ -24,7 +24,7 @@ public class Log { | @@ -24,7 +24,7 @@ public class Log { | ||
24 | //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 | 24 | //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 |
25 | private static int onlineCount = 0; | 25 | private static int onlineCount = 0; |
26 | //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 | 26 | //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 |
27 | - private static CopyOnWriteArraySet<Log> webSocketSet = new CopyOnWriteArraySet<Log>(); | 27 | + private static CopyOnWriteArraySet<LogWebsockController> webSocketSet = new CopyOnWriteArraySet<LogWebsockController>(); |
28 | 28 | ||
29 | 29 | ||
30 | @OnOpen | 30 | @OnOpen |
@@ -67,7 +67,7 @@ public class Log { | @@ -67,7 +67,7 @@ public class Log { | ||
67 | } | 67 | } |
68 | 68 | ||
69 | public static synchronized void addOnlineCount() { | 69 | public static synchronized void addOnlineCount() { |
70 | - Log.onlineCount++; | 70 | + LogWebsockController.onlineCount++; |
71 | } | 71 | } |
72 | public static synchronized int getOnlineCount() { | 72 | public static synchronized int getOnlineCount() { |
73 | return onlineCount; | 73 | return onlineCount; |
@@ -4,9 +4,9 @@ import org.springframework.stereotype.Controller; | @@ -4,9 +4,9 @@ import org.springframework.stereotype.Controller; | ||
4 | import org.springframework.web.bind.annotation.RequestMapping; | 4 | import org.springframework.web.bind.annotation.RequestMapping; |
5 | 5 | ||
6 | @Controller | 6 | @Controller |
7 | -public class Login { | 7 | +public class LoginController { |
8 | 8 | ||
9 | - @RequestMapping("/loginPage") | 9 | + @RequestMapping("/login") |
10 | public String login(){ | 10 | public String login(){ |
11 | return "login"; | 11 | return "login"; |
12 | } | 12 | } |
-
请 注册 或 登录 后发表评论