|
|
@ -577,14 +577,14 @@ public class DcDeviceController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询物联设备事件数据 |
|
|
|
* 查询物联设备指定事件数据 |
|
|
|
* |
|
|
|
* @param deviceId 物联设备id |
|
|
|
* @param eventId 事件id |
|
|
|
* @param queryParam 查询条件 |
|
|
|
* @return 查询事件结果 |
|
|
|
*/ |
|
|
|
@ApiOperation("查询事件历史数据列表") |
|
|
|
@ApiOperation("查询指定事件历史数据列表") |
|
|
|
@GetMapping("/events/history/{deviceId}/{eventId}") |
|
|
|
public AjaxResult queryPagerDeviceEvents( |
|
|
|
@PathVariable @Parameter(description = "设备ID") String deviceId, |
|
|
@ -608,6 +608,43 @@ public class DcDeviceController extends BaseController { |
|
|
|
return JSON.parseObject(response.body().string(), AjaxResult.class); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 查询物联设备指定事件数据 |
|
|
|
* |
|
|
|
* @param deviceId 物联设备id |
|
|
|
* @param type 类型 |
|
|
|
* @param queryParam 查询条件 |
|
|
|
* @return 查询事件结果 |
|
|
|
*/ |
|
|
|
@ApiOperation("查询指定事件历史数据列表") |
|
|
|
@GetMapping("/events/history/{deviceId}/type/{type}") |
|
|
|
public AjaxResult listPagerDeviceEvents( |
|
|
|
@PathVariable @Parameter(description = "设备ID") String deviceId, |
|
|
|
@PathVariable @Parameter(description = "事件ID") String type, |
|
|
|
@Parameter(hidden = true) HashMap<String, Object> queryParam |
|
|
|
) throws HttpException, IOException { |
|
|
|
|
|
|
|
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(type)) { |
|
|
|
return AjaxResult.error("设备未接入"); |
|
|
|
} |
|
|
|
if (type.equals("all")){ |
|
|
|
|
|
|
|
OkHttp okHttp = new OkHttp(); |
|
|
|
|
|
|
|
RequestParams requestParams = new RequestParams(queryParam); |
|
|
|
|
|
|
|
Response response // 请求响应
|
|
|
|
= okHttp |
|
|
|
.url(iotAddress + "/api/iot/device/logs/"+deviceId) // 请求地址
|
|
|
|
.data(requestParams) |
|
|
|
.get(); // 请求方法
|
|
|
|
return JSON.parseObject(response.body().string(), AjaxResult.class); |
|
|
|
}else { |
|
|
|
return queryPagerDeviceEvents(deviceId, type, queryParam); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取物联设备物模型 |
|
|
|
* |
|
|
|