From a4c84773afd8691ee95c48793e53480accab6886 Mon Sep 17 00:00:00 2001 From: jinpengyong <jpy123456> Date: Tue, 02 Nov 2021 16:25:36 +0800 Subject: [PATCH] update --- screen-api/src/main/java/com/moral/api/controller/AqiController.java | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 48 insertions(+), 1 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/controller/AqiController.java b/screen-api/src/main/java/com/moral/api/controller/AqiController.java index ae587b0..640f34f 100644 --- a/screen-api/src/main/java/com/moral/api/controller/AqiController.java +++ b/screen-api/src/main/java/com/moral/api/controller/AqiController.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -34,7 +35,7 @@ @ApiImplicitParams(value = { @ApiImplicitParam(name = "regionCode", value = "������", required = true, paramType = "query", dataType = "String") }) - public ResultMessage MeasuredCompareForecast(HttpServletRequest request) { + public ResultMessage measuredCompareForecast(HttpServletRequest request) { Map<String, Object> params = WebUtils.getParametersStartingWith(request, null); if (!params.containsKey("regionCode") || !params.containsKey("time")) { return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); @@ -43,9 +44,55 @@ return ResultMessage.ok(response); } + /** + * @Description: ���������������6������aqi������ + * @Param: [regionCode] + * @return: com.moral.constant.ResultMessage + * @Author: ��������� + * @Date: 2021/11/1 + */ @GetMapping("queryByRegionCode") public ResultMessage queryByRegionCode(Integer regionCode){ Map<String, Object> value = cityAqiService.queryCityAqiByRegionCode(regionCode); return ResultMessage.ok(value); } + + /** + * @Description: ������������24���������aqi������ + * @Param: [regionCode] + * @return: com.moral.constant.ResultMessage + * @Author: ��������� + * @Date: 2021/11/1 + */ + @GetMapping("query24HoursAQI") + public ResultMessage query24HoursAQIByRegionCode(Integer regionCode){ + Map<String, Object> datas = cityAqiService.query24HoursAqiByRegionCode(regionCode); + return ResultMessage.ok(datas); + } + + /** + * @Description: ���������������������aqi��������������������� + * @Param: [RegionCode] + * @return: com.moral.constant.ResultMessage + * @Author: ��������� + * @Date: 2021/11/2 + */ + @GetMapping("queryTodayAqiAndPollutant") + public ResultMessage queryTodayAqiAndPollutant(Integer regionCode){ + Map<String, Object> datas = cityAqiService.queryTodayAqiAndPollutant(regionCode); + return ResultMessage.ok(datas); + } + + @GetMapping("provincialRanking") + @ApiOperation(value = "������������", notes = "������������") + @ApiImplicitParams(value = { + @ApiImplicitParam(name = "organizationId", value = "������id", required = true, paramType = "query", dataType = "Integer") + }) + public ResultMessage provincialRanking(Integer organizationId) { + if (ObjectUtils.isEmpty(organizationId)) { + return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); + } + Map<String, Object> response = cityAqiService.provincialRanking(organizationId); + return ResultMessage.ok(response); + } } -- Gitblit v1.8.0