| | |
| | | package com.moral.api.controller; |
| | | |
| | | import com.moral.api.pojo.dto.dataDisplay.PollutionLevelProportionDTO; |
| | | import com.moral.api.pojo.dto.dataDisplay.PieChartOfPollutionLevelDTO; |
| | | import com.moral.api.pojo.form.aqi.QueryPieChartOfPollutionLevelForm; |
| | | import com.moral.api.service.CityAqiDailyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | return ResultMessage.ok(datas); |
| | | } |
| | | |
| | | @GetMapping("queryPollutionLevelsForThisYear") |
| | | public ResultMessage queryPollutionLevelsForThisYear(Integer regionCode){ |
| | | PollutionLevelProportionDTO dto = cityAqiDailyService.queryPollutionLevelsForThisYear(regionCode); |
| | | /** |
| | | * @Description: 首页右下角,污染天数占比的饼状图 |
| | | * @Param: [regionCode] |
| | | * @return: com.moral.constant.ResultMessage |
| | | * @Author: 陈凯裕 |
| | | * @Date: 2021/11/11 |
| | | */ |
| | | @GetMapping("queryPieChartOfPollutionLevel") |
| | | public ResultMessage queryPieChartOfPollutionLevel(QueryPieChartOfPollutionLevelForm form){ |
| | | //判断是否缺少参数 |
| | | if (!form.valid()) |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), |
| | | ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | |
| | | PieChartOfPollutionLevelDTO dto = cityAqiDailyService.queryPieChartOfPollutionLevels(form); |
| | | return ResultMessage.ok(dto); |
| | | } |
| | | |