From a5353feebdef3812ea7692603263fe0217d5bc15 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 20 三月 2025 09:41:02 +0800
Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat-sdk-demo

---
 src/main/java/com/iailab/sdk/demo/HttpClientDemo.java |   63 ++++---------------------------
 1 files changed, 8 insertions(+), 55 deletions(-)

diff --git a/src/main/java/com/iailab/sdk/demo/HttpClientDemo.java b/src/main/java/com/iailab/sdk/demo/HttpClientDemo.java
index 1f386ef..ecdf09c 100644
--- a/src/main/java/com/iailab/sdk/demo/HttpClientDemo.java
+++ b/src/main/java/com/iailab/sdk/demo/HttpClientDemo.java
@@ -2,71 +2,24 @@
 
 import com.iailab.sdk.auth.client.IailabClient;
 import com.iailab.sdk.auth.client.common.pojo.CommonResult;
-import com.iailab.sdk.auth.client.dto.ApiDataQueryDTO;
-import com.iailab.sdk.auth.client.dto.TokenDTO;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.List;
+import java.util.Map;
 
 
 /**
  * @author iailab
  */
 @RestController
+@RequestMapping("/demo")
 public class HttpClientDemo {
 
-
-    /**
-     * 获取平台授权token及refreshToken
-     */
-    public void authenticate() {
-        TokenDTO authenticate = IailabClient.authenticate();
-        System.out.println(authenticate);
-    }
-
-    /**
-     * 根据refreshToken刷新授权token
-     * @throws Exception
-     */
-    public void refreshToken() throws Exception {
-        IailabClient.authenticate();
-        TokenDTO authenticate = IailabClient.refreshToken();
-        System.out.println(authenticate);
-    }
-
-
-    public CommonResult<Map<String, Object>> queryPointsRealValue() throws Exception {
-        List<String> pointNos = new ArrayList<>();
-        pointNos.add("F0000120031");
+    @PostMapping("/query-points/history-value")
+    public CommonResult<Map<String, Object>> queryPointsRealValue(@RequestBody List<String> pointNos) {
         return IailabClient.getInstance().queryPointsRealValue(pointNos);
-    }
-
-    /**
-     * 测试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 = IailabClient.doHttp("POST", "http://172.16.8.100/admin-api/data/api/query-plans/chart", 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 = IailabClient.doHttp("get", "http://172.16.8.100/admin-api/data/api/device-value", params);
-        System.out.println(s);
     }
 }

--
Gitblit v1.9.3