|
|
@@ -3,10 +3,10 @@ package com.zhongshu.iot.server.core.util;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.zhongshu.iot.server.core.dataConfig.DeviceConfig;
|
|
|
import com.zhongshu.iot.server.core.dataConfig.MqttConfig;
|
|
|
import com.zhongshu.iot.server.core.domain.iot.device.DeviceInfo;
|
|
|
-import com.zhongshu.iot.server.core.domain.iot.device.GateWayUserInfo;
|
|
|
import com.zhongshu.iot.server.core.domain.iot.device.MqttInfo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
@@ -74,16 +74,6 @@ public class JMXUtil {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- public static List<String> buildAddressMatch(List<DeviceInfo> deviceInfoList) {
|
|
|
- List<String> list = new ArrayList<String>();
|
|
|
- if (ObjectUtils.isNotEmpty(deviceInfoList)) {
|
|
|
- deviceInfoList.stream().forEach(deviceInfo -> {
|
|
|
- list.add(String.format("/device/%s/#", deviceInfo.getDeviceId()));
|
|
|
- });
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
public static List<String> buildDeviceAddressMatch(DeviceInfo deviceInfo) {
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
if (ObjectUtils.isNotEmpty(deviceInfo)) {
|
|
|
@@ -93,23 +83,10 @@ public class JMXUtil {
|
|
|
}
|
|
|
|
|
|
public static List<String> buildGateWayAddressMatch(DeviceInfo gateWayInfo) {
|
|
|
- List<String> list = new ArrayList<String>();
|
|
|
- if (ObjectUtils.isNotEmpty(gateWayInfo)) {
|
|
|
- list.add(String.format("/device/%s/#", gateWayInfo.getDeviceId()));
|
|
|
- }
|
|
|
- return list;
|
|
|
- }
|
|
|
-
|
|
|
- public static List<String> buildGateWayUserDefault(GateWayUserInfo gateWayUserInfo) {
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- if (ObjectUtils.isNotEmpty(gateWayUserInfo)) {
|
|
|
- list.add(String.format("/platform/%s/register", gateWayUserInfo.getUserName()));
|
|
|
- list.add(String.format("/platform/%s/ping", gateWayUserInfo.getUserName()));
|
|
|
- list.add(String.format("/platform/%s/onLine", gateWayUserInfo.getUserName()));
|
|
|
- list.add(String.format("/platform/%s/unLine", gateWayUserInfo.getUserName()));
|
|
|
- list.add(String.format("/platform/%s/systemTime", gateWayUserInfo.getUserName()));
|
|
|
+ if (ObjectUtils.isEmpty(gateWayInfo)) {
|
|
|
+ return Lists.newArrayList();
|
|
|
}
|
|
|
- return list;
|
|
|
+ return List.of(String.format("/device/%s/#", gateWayInfo.getDeviceId()));
|
|
|
}
|
|
|
|
|
|
public static String buildSecurityRoleName(String roleName) {
|