Commit b00e2260 authored by huangcb's avatar huangcb

获取设备接入信息功能接口优化

parent 25d31d5f
......@@ -70,10 +70,13 @@ public class DeviceInstanceServiceImpl extends ServiceImpl<DeviceInstanceDao, De
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteInstance(Long id) {
// 获取实例信息
DeviceInstanceEntity deviceInstanceEntity = this.getInstanceById(id);
// 删除实例
this.getBaseMapper().deleteById(id);
// 删除设备Mqtt Topic权限记录
DeviceInstanceEntity deviceInstanceEntity = this.getInstanceById(id);
mqttClientAuthComponent.deleteClientAcl(deviceInstanceEntity.getCommunicationId());
}
......@@ -259,9 +262,13 @@ public class DeviceInstanceServiceImpl extends ServiceImpl<DeviceInstanceDao, De
List<DeviceInstanceMqttTopicInfoVO> mqttTopicInfoVOList = new ArrayList<>();
for (DeviceInstanceFullMapDto dto : deviceInstanceFullMapDtoList) {
DeviceInstanceMqttTopicInfoVO topicInfoVO = new DeviceInstanceMqttTopicInfoVO();
if (Objects.isNull(dto.getDataModelId())) {
continue;
}
topicInfoVO.setDataModelId(dto.getDataModelId());
topicInfoVO.setDataModelName(dto.getDataModelName());
topicInfoVO.setMqttTopic(mqttTopicMap.get(dto.getDataModelId()));
mqttTopicInfoVOList.add(topicInfoVO);
}
vo.setMqttTopicInfoVOList(mqttTopicInfoVOList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment