|
@@ -65,11 +65,31 @@ public class RestClientService {
|
|
|
/**
|
|
|
* author: dzc
|
|
|
* version: 1.0
|
|
|
+ * des: 根据组织id 获取设备信息
|
|
|
+ * date: 2024/8/9
|
|
|
+ */
|
|
|
+
|
|
|
+ public JSONObject getGroupDevicesInfo(String groupId,String elToken){
|
|
|
+ //String url = "http://127.0.0.1:8082/v1/devices?deviceType=&groupID="+groupId+"&projectID=all&productID=all";
|
|
|
+ String url = configService.getConfigValue(ConfigInfo.IOTEDGE_GETINFOBYGROUPID)+groupId+"&projectID=all&productID=all";
|
|
|
+ //String accessToken = getAccessToken();
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
|
+ headers.setContentType(type);
|
|
|
+ headers.add("Authorization", "Bearer " + elToken);
|
|
|
+ HttpEntity<String> httpEntity = new HttpEntity<String>(null, headers);
|
|
|
+ ResponseEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.GET,httpEntity, JSONObject.class);
|
|
|
+ return response.getBody();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * author: dzc
|
|
|
+ * version: 1.0
|
|
|
* des: 调用IoTEdge接口 获取所有设备信息
|
|
|
* date: 2024/5/29
|
|
|
*/
|
|
|
public JSONObject getAllDevicesInfo(String elToken){
|
|
|
- //String url = "http://127.0.0.1:8082/v1/devices?deviceType=&projectID=all&productID=all";
|
|
|
+ //String url = "http://127.0.0.1:8082/v1/devices?deviceType=&groupID="+groupId+"&projectID=all&productID=all";
|
|
|
String url = configService.getConfigValue(ConfigInfo.GETALLDEVICESINFO);
|
|
|
//String accessToken = getAccessToken();
|
|
|
HttpHeaders headers = new HttpHeaders();
|