From d097b6d0ede9a50036f2e57e04832a2d916ec60b Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期四, 20 三月 2025 18:08:47 +0800 Subject: [PATCH] demo --- src/test/java/com/iailab/sdk/demo/HttpClientDemoTest.java | 46 +++++++++++++++++++++++++++++++--------------- 1 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/test/java/com/iailab/sdk/demo/HttpClientDemoTest.java b/src/test/java/com/iailab/sdk/demo/HttpClientDemoTest.java index ea9a33d..ee15eeb 100644 --- a/src/test/java/com/iailab/sdk/demo/HttpClientDemoTest.java +++ b/src/test/java/com/iailab/sdk/demo/HttpClientDemoTest.java @@ -1,10 +1,21 @@ package com.iailab.sdk.demo; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.iailab.sdk.auth.client.common.pojo.CommonResult; +import com.iailab.sdk.auth.client.common.pojo.PageResult; +import com.iailab.sdk.auth.client.dto.StAlarmAndSuggestPageReqDTO; +import com.iailab.sdk.auth.client.dto.StAlarmAndSuggestRespDTO; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @RunWith(SpringRunner.class) @@ -15,27 +26,32 @@ private HttpClientDemo httpClientDemo; @Test - public void testDoGet() throws Exception { - httpClientDemo.HttpGet(); + public void testQueryPointsRealValue() { + List<String> pointNos = new ArrayList<>(); + pointNos.add("F0000120076"); + CommonResult<Map<String, Object>> commonResult = httpClientDemo.queryPointsRealValue(pointNos); + System.out.println(commonResult.getData()); } @Test - public void testDoPost() throws Exception { - httpClientDemo.HttpPost(); + public void testGetAlarmAndSuggestPage() { + StAlarmAndSuggestPageReqDTO reqVO = new StAlarmAndSuggestPageReqDTO(); + reqVO.setObj("Air"); + CommonResult<PageResult<StAlarmAndSuggestRespDTO>> commonResult = httpClientDemo.getAlarmAndSuggestPage(reqVO); + System.out.println(commonResult.getData().getList()); } @Test - public void testGetDeviceValue() throws Exception { - httpClientDemo.HttpGetDeviceValue(); + public void testHandleHttp() { + Map<String, Object> params = new HashMap<>(); + params.put("chartCode","BFG_PRED01"); + String url = "/ansteel/api/mcs/predict-data/charts"; + CommonResult<Object> commonResult = httpClientDemo.handleHttp("POST",url,params); + System.out.println(commonResult.getData()); + +// String url = "/ansteel/api/mcs/power-run-state/list"; +// CommonResult<Object> commonResult = httpClientDemo.handleHttp("GET",url,params); +// System.out.println(commonResult.getData()); } - @Test - public void authenticate() { - httpClientDemo.authenticate(); - } - - @Test - public void refreshToken() throws Exception { - httpClientDemo.refreshToken(); - } } -- Gitblit v1.9.3