修改代码
This commit is contained in:
parent
054460beaf
commit
6cad98b742
|
|
@ -12,6 +12,7 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|||
import org.springframework.stereotype.Component;
|
||||
import org.thingsboard.rest.client.RestClient;
|
||||
import org.thingsboard.server.common.data.Device;
|
||||
import org.thingsboard.server.common.data.EntityType;
|
||||
import org.thingsboard.server.common.data.id.DeviceId;
|
||||
import org.thingsboard.server.common.data.id.EntityId;
|
||||
import org.thingsboard.server.common.data.kv.AttributeKvEntry;
|
||||
|
|
@ -245,10 +246,22 @@ public class ThingsBoardDomainImpl implements IThingsBoardDomain {
|
|||
List<String> childDeviceIds = new ArrayList<>();
|
||||
|
||||
try {
|
||||
DeviceId gatewayId = new DeviceId(UUID.fromString(gatewayDeviceId));
|
||||
|
||||
// 调用 findInfoByFrom 查询从网关出发的关系信息
|
||||
// 对应前端 API: GET /api/relations/info?fromId=xxx&fromType=DEVICE&relationTypeGroup=COMMON
|
||||
|
||||
EntityId gatewayId = new EntityId() {
|
||||
@Override
|
||||
public UUID getId() {
|
||||
return UUID.fromString(gatewayDeviceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType getEntityType() {
|
||||
return EntityType.DEVICE;
|
||||
}
|
||||
};
|
||||
|
||||
List<EntityRelationInfo> relationInfos = client.findInfoByFrom(
|
||||
gatewayId,
|
||||
RelationTypeGroup.COMMON
|
||||
|
|
|
|||
Loading…
Reference in New Issue