From c561dda269a3c62453b56a46e4deee8154b17d8b Mon Sep 17 00:00:00 2001
From: wangjunyi <junyi.wang@hiscene.com>
Date: 星期四, 27 四月 2023 16:26:29 +0800
Subject: [PATCH] 创建回调函数时,不可带上括号,否则会在调用此语句时,立即执行一次回调函数
---
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarmMethod.java | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarmMethod.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarmMethod.java
index ff8761e..d1fb6db 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarmMethod.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarmMethod.java
@@ -37,4 +37,18 @@
public int getVal() {
return val;
}
+
+ /**
+ * 鏌ヨ鏄惁鍖归厤绫诲瀷
+ * @param code
+ * @return
+ */
+ public static DeviceAlarmMethod typeOf(int code) {
+ for (DeviceAlarmMethod item : DeviceAlarmMethod.values()) {
+ if (code==item.getVal()) {
+ return item;
+ }
+ }
+ return null;
+ }
}
--
Gitblit v1.8.0