From 014f0297513088601b2db6177dbf790cf47aa1bd Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Tue, 03 Aug 2021 17:31:40 +0800
Subject: [PATCH] 监测因子趋势图更改请求方式为Post

---
 screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java |    6 +++---
 screen-api/src/main/java/com/moral/api/controller/WebController.java       |   17 ++++++++---------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/controller/WebController.java b/screen-api/src/main/java/com/moral/api/controller/WebController.java
index 0345043..0e5b460 100644
--- a/screen-api/src/main/java/com/moral/api/controller/WebController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/WebController.java
@@ -7,11 +7,11 @@
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
+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.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
@@ -136,17 +136,16 @@
      * @param request ������������
      * @return ������������������������������������
      */
-    @GetMapping("getTrendChartData")
+    @PostMapping("getTrendChartData")
     @ApiOperation(value = "���������������������������������", notes = "���������������������������������.")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
-            @ApiImplicitParam(name = "macs", value = "������mac���������������������", required = true, paramType = "query", dataType = "String"),
-            @ApiImplicitParam(name = "sensorCode", value = "������code", required = true, paramType = "query", dataType = "String"),
-            @ApiImplicitParam(name = "type", value = "���������������������day���,������month���,������year���", required = true, paramType = "query", dataType = "String"),
-            @ApiImplicitParam(name = "times", value = "���������������������2021-07-29������������2021-07������������2021������������������������", required = true, paramType = "query", dataType = "String")
+            @ApiImplicitParam(name = "macs", value = "������mac���������������������", required = true, paramType = "body", dataType = "String"),
+            @ApiImplicitParam(name = "sensorCode", value = "������code", required = true, paramType = "body", dataType = "String"),
+            @ApiImplicitParam(name = "type", value = "���������������������day���,������month���,������year���", required = true, paramType = "body", dataType = "String"),
+            @ApiImplicitParam(name = "times", value = "���������������������2021-07-29������������2021-07������������2021������������������������", required = true, paramType = "body", dataType = "String")
     })
-    public ResultMessage getTrendChartData(HttpServletRequest request) {
-        Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
+    public ResultMessage getTrendChartData(@RequestBody Map<String,Object> params) {
         if (!params.containsKey("macs") || !params.containsKey("sensorCode") || !params.containsKey("type") || !params.containsKey("times")) {
             return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
         }
diff --git a/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
index a67255f..133b8ae 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/DeviceServiceImpl.java
@@ -50,7 +50,7 @@
     @Override
     public List<Device> getDevicesByMonitorPointId(Integer monitorPointId) {
         QueryWrapper<Device> wrapper = new QueryWrapper();
-        wrapper.eq("monitor_point_id",monitorPointId);
+        wrapper.eq("monitor_point_id", monitorPointId);
         wrapper.eq("is_delete", Constants.NOT_DELETE);
         return deviceMapper.selectList(wrapper);
     }
@@ -86,9 +86,9 @@
     public List<Map<String, Object>> getTrendChartData(Map<String, Object> params) {
         Object type = params.get("type");
         //������mac
-        String[] macs = params.remove("macs").toString().split(",");
+        List<String> macs = (List<String>) params.remove("macs");
         //������������
-        String[] times = params.remove("times").toString().split(",");
+        List<String> times = (List<String>) params.remove("times");
         //������code
         String sensorCode = params.get("sensorCode").toString();
         String end;

--
Gitblit v1.8.0