|
|
@@ -6,9 +6,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.zksy.common.core.domain.Result;
|
|
|
import com.zksy.visualization.config.IccConfigProperty;
|
|
|
import com.zksy.visualization.domain.request.ChannelPageRequest;
|
|
|
+import com.zksy.visualization.domain.request.DevicePageRequest;
|
|
|
import com.zksy.visualization.domain.request.DeviceTreeRequest;
|
|
|
import com.zksy.visualization.domain.response.ChannelPageResponse;
|
|
|
import com.zksy.visualization.domain.response.DeviceDetailsResponse;
|
|
|
+import com.zksy.visualization.domain.response.DevicePageResponse;
|
|
|
import com.zksy.visualization.domain.response.DeviceTreeResponse;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@@ -83,7 +85,7 @@ public class DeviceInfoController {
|
|
|
}
|
|
|
return Result.error("设备详情查询失败");
|
|
|
}
|
|
|
-/* @ApiOperation(value = "设备分页查询")
|
|
|
+ @ApiOperation(value = "设备分页查询")
|
|
|
@PostMapping("/devicePage")
|
|
|
public Result devicePage(DevicePageRequest request){
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
@@ -115,23 +117,22 @@ public class DeviceInfoController {
|
|
|
String responseString = responseBody.string();
|
|
|
JsonNode rootNode = objectMapper.readTree(responseString);
|
|
|
JsonNode success = rootNode.path("success");
|
|
|
- if(success.isBoolean()) {
|
|
|
+ if("true".equals(success.asText())) {
|
|
|
JsonNode dataNode = rootNode.path("data");
|
|
|
- if (dataNode.isObject()) {
|
|
|
- DevicePageResponse intelligentPanelResponse = objectMapper.treeToValue(dataNode, DevicePageResponse.class);
|
|
|
- return Result.ok(intelligentPanelResponse);
|
|
|
+ if (dataNode != null) {
|
|
|
+ return Result.ok(dataNode);
|
|
|
} else {
|
|
|
return Result.ok(null);
|
|
|
}
|
|
|
}else {
|
|
|
- return Result.error("分页获取通道信息失败");
|
|
|
+ return Result.error("设备分页查询失败");
|
|
|
}
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
log.error("请求失败: {}", e);
|
|
|
}
|
|
|
return Result.error("请求失败");
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "设备树查询")
|
|
|
@PostMapping("/deviceTree")
|