From 477b3197e1ded6920461094a8f449d99e5c67f9d Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Tue, 03 Aug 2021 17:47:33 +0800 Subject: [PATCH] 更改请求方式 --- screen-api/src/main/java/com/moral/api/controller/WebController.java | 24 +++++++++++------------- 1 files changed, 11 insertions(+), 13 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..4f3ecfc 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; @@ -117,14 +117,13 @@ * @param request ������������ * @return ������������������������������������ */ - @GetMapping("getMacSensors") + @PostMapping("getMacSensors") @ApiOperation(value = "������������mac������������������", notes = "������������mac������������������") @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 = "macs", value = "������mac���������������������", required = true, paramType = "query", dataType = "List") }) - public ResultMessage getMacSensors(HttpServletRequest request) { - Map<String, Object> params = WebUtils.getParametersStartingWith(request, null); + 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()); } @@ -136,17 +135,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 = "List"), + @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); + 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()); } -- Gitblit v1.8.0