| | |
| | | package com.iailab.sdk.demo; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.iailab.sdk.auth.client.IailabAuthClient; |
| | | import com.iailab.sdk.auth.client.dto.TokenDTO; |
| | |
| | | } |
| | | |
| | | public void HttpGetDeviceValue() throws Exception { |
| | | Map<String, String> params = new HashMap<>(); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("pointNos", "M0000101158,M0000101157,M0000101156,M0000101155,F0000120026"); |
| | | String s = IailabHttpUtils.doGet(baseUrl + deviceValue, params, "utf-8"); |
| | | System.out.println(s); |
| | |
| | | TokenDTO authenticate = IailabAuthClient.refreshToken(); |
| | | System.out.println(authenticate); |
| | | } |
| | | |
| | | /** |
| | | * 测试doHttp post请求 |
| | | * @throws Exception |
| | | */ |
| | | public void doHttpPost() throws Exception { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | List<String> itemNos = new ArrayList<>(); |
| | | params.put("start", "2024-06-11 07:24:00"); |
| | | params.put("end", "2024-06-13 00:00:00"); |
| | | params.put("itemNo", null); |
| | | params.put("granularity", null); |
| | | itemNos.add("P0000100010"); |
| | | params.put("itemNos", itemNos); |
| | | String s = IailabAuthClient.doHttp("POST", baseUrl + queryPlansChart, params); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | /** |
| | | * 测试doHttp get请求 |
| | | * @throws Exception |
| | | */ |
| | | public void doHttpGet() throws Exception { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("pointNos", "M0000101158,M0000101157,M0000101156,M0000101155,F0000120026"); |
| | | String s = IailabAuthClient.doHttp("get", baseUrl + deviceValue, params); |
| | | System.out.println(s); |
| | | } |
| | | } |