public List<DeviceEntity> getDeviceEntitiesByType(String type) {
Document query = new Document("type", type);
List<DeviceEntity> result = new ArrayList<>();
collection.find(query).forEach((Block<? super Document>) document -> {
Short devId = document.getInteger("dev_id").shortValue();
String category = document.getString("category");
String name = document.getString("name");
boolean isTrusted = document.getBoolean("isTrusted");
result.add(new DeviceEntity(devId, name, category, type, isTrusted));
});
return result;
}
DeviceSetupRepository.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:HomeWire-Server
作者:
评论列表
文章目录