From 5d2e6ca50091f405dfda9e287b367dd295dc6cf8 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Mon, 09 Feb 2026 17:39:17 +0800
Subject: [PATCH] 1. 航线任务增加校验,只有下发人和登陆人是一个人才可以删除修改操作。 2. 增加校验航线任务是否可以创建航线接口。
---
ard-sample/src/main/java/com/ard/sample/component/websocket/enums/MessageType.java | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/ard-sample/src/main/java/com/ard/sample/component/websocket/enums/MessageType.java b/ard-sample/src/main/java/com/ard/sample/component/websocket/enums/MessageType.java
index e46ea77..4f08004 100644
--- a/ard-sample/src/main/java/com/ard/sample/component/websocket/enums/MessageType.java
+++ b/ard-sample/src/main/java/com/ard/sample/component/websocket/enums/MessageType.java
@@ -5,6 +5,10 @@
STATUS("status"),
CONTROL("control"),
PROGRESS("progress"),
+ LIVESTREAM("livestream"),
+ LIVESTATUS("livestatus"),
+ PING("ping"), // 新增心跳请求
+ PONG("pong"), // 新增心跳响应
ALL("all");
private final String type;
@@ -17,12 +21,19 @@
return type;
}
- public static MessageType fromString(String type) {
+ public static boolean fromString(String type) {
+ // 遍历MessageType枚举的所有值
for (MessageType messageType : MessageType.values()) {
+ // 如果当前枚举值的type属性与传入的type字符串忽略大小写相等
if (messageType.type.equalsIgnoreCase(type)) {
- return messageType;
+ // 返回当前枚举值
+ //return messageType;
+ return true;
}
}
- throw new IllegalArgumentException("Unknown message type: " + type);
+ // 如果遍历完所有枚举值都没有找到匹配的,则抛出异常
+ //throw new IllegalArgumentException("Unknown message type: " + type);
+ return false;
}
+
}
--
Gitblit v1.9.3