TRX il y a 1 an
Parent
commit
bdf36645a3

+ 8 - 7
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/device/GateWayUserInfoService.java

@@ -351,7 +351,9 @@ public class GateWayUserInfoService {
                         if (JMXUtil.mqttUserIsExit(oldUserStr)) {
                             addressControl.removeUser(gateWayUserInfo.getUserName());
                         }
+                        // 添加用户
                         addressControl.addUser(gateWayUserInfo.getUserName(), gateWayUserInfo.getPassWord(), gateWayUserInfo.getRoleName(), false);
+
                         // 添加用户的默认权限
                         List<String> security = JMXUtil.buildGateWayUserDefault(gateWayUserInfo);
                         if (ObjectUtils.isNotEmpty(security)) {
@@ -477,6 +479,12 @@ public class GateWayUserInfoService {
         return ResultContent.buildSuccess();
     }
 
+    /**
+     * 同步网关的权限
+     *
+     * @param gateWayInfo
+     * @return
+     */
     public ResultContent syncSecurityGateToMQTTService(GateWayInfo gateWayInfo) {
         //todo同步权限
         List<MqttInfo> list = mqttInfoDao.findAll();
@@ -489,13 +497,6 @@ public class GateWayUserInfoService {
         return ResultContent.buildSuccess();
     }
 
-    public ResultContent syncSecurityToMQTTService(GateWayUserInfo gateWayUserInfo) {
-        if (ObjectUtils.isNotEmpty(gateWayUserInfo)) {
-
-        }
-        return ResultContent.buildSuccess();
-    }
-
     public ResultContent syncSecurityToMQTTService(List<GateWayInfo> gateWayInfos) {
         //todo同步权限
         List<MqttInfo> list = mqttInfoDao.findAll();