From e4ebf74baef4faab3fa794c042e2921437525e6e Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Thu, 12 Aug 2021 10:40:52 +0800
Subject: [PATCH] update
---
screen-api/src/main/java/com/moral/api/controller/WebController.java | 57 +++++++++++++++++++++++++++++----------------------------
1 files changed, 29 insertions(+), 28 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 6a3caac..7562116 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,6 +7,8 @@
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;
@@ -26,9 +28,10 @@
/**
* web���������
- * @author moral
- * @version v1.0
- * */
+ *
+ * @author moral
+ * @version v1.0
+ */
@Slf4j
@Api(tags = {"web���������"})
@RestController
@@ -53,7 +56,7 @@
/**
* @param request ������������
* @return ������������������������������������
- * */
+ */
@GetMapping("getHourlyAqi")
@ApiOperation(value = "���������������AQI", notes = "���������������AQI")
@ApiImplicitParams(value = {
@@ -72,7 +75,7 @@
/**
* @param request ������������
* @return ������������������������������������
- * */
+ */
@GetMapping("getMonthAvg")
@ApiOperation(value = "������������������������������������", notes = "������������������������������������")
@ApiImplicitParams(value = {
@@ -92,12 +95,12 @@
/**
* @param request ������������
* @return ������������������������������������
- * */
+ */
@GetMapping("getWindData")
@ApiOperation(value = "������������������", notes = "������������������")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
- @ApiImplicitParam(name = "monitorPointId", value = "������id", required = true, paramType = "query", dataType = "String")
+ @ApiImplicitParam(name = "monitorPointIds", value = "������id", required = true, paramType = "query", dataType = "String")
})
public ResultMessage getWindData(HttpServletRequest request) {
Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
@@ -111,40 +114,38 @@
}
/**
- * @param request ������������
+ * @param params ������������
* @return ������������������������������������
- * */
- @GetMapping("getMacSensors")
- @ApiOperation(value = "������mac������������������������", notes = "������mac������������������������")
+ */
+ @PostMapping("getMacSensors")
+ @ApiOperation(value = "������������mac������������������", notes = "������������mac������������������")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
- @ApiImplicitParam(name = "mac", value = "������mac", required = true, paramType = "query", dataType = "String")
+ @ApiImplicitParam(name = "macs", value = "������mac���������������������", required = true, paramType = "query", dataType = "List")
})
- public ResultMessage getMacSensors(HttpServletRequest request) {
- Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
- if (!params.containsKey("mac")) {
+ public ResultMessage getMacSensors(@RequestBody Map<String,Object> params) {
+ if (!params.containsKey("macs")) {
return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
}
- Map<String, Object> response = deviceService.getSensorsByMac(params.get("mac").toString());
+ Map<String, Object> response = deviceService.getSensorsByMac(params);
return ResultMessage.ok(response);
}
/**
- * @param request ������������
+ * @param params ������������
* @return ������������������������������������
- * */
- @GetMapping("getTrendChartData")
- @ApiOperation(value = "���������������������������������", notes = "���������������������������������")
+ */
+ @PostMapping("getTrendChartData")
+ @ApiOperation(value = "���������������������������������", notes = "���������������������������������.")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"),
- @ApiImplicitParam(name = "mac", 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 = "time", value = "������������", required = true, paramType = "query", dataType = "String")
+ @ApiImplicitParam(name = "macs", value = "������mac���������������������", required = true, paramType = "body", dataType = "list"),
+ @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 = "List")
})
- public ResultMessage getTrendChartData(HttpServletRequest request) {
- Map<String, Object> params = WebUtils.getParametersStartingWith(request, null);
- if (!params.containsKey("mac") || !params.containsKey("sensorCode") || !params.containsKey("type") || !params.containsKey("time")) {
+ 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());
}
List<Map<String, Object>> response = deviceService.getTrendChartData(params);
@@ -154,7 +155,7 @@
/**
* @param request ������������
* @return ������������������������������������
- * */
+ */
@GetMapping("getMapPath")
@ApiOperation(value = "������������������������������", notes = "������������������������������")
@ApiImplicitParams(value = {
--
Gitblit v1.8.0