chen_xi
2023-06-29 213b9ff531e42119f0346c5a3e7279798e089d86
screen-api/src/main/java/com/moral/api/controller/AqiController.java
@@ -14,6 +14,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
@@ -315,4 +316,38 @@
        return  ResultMessage.ok(result);
    }
    /**
    * @Description: 查询市内所有县的排名 附件7
            * @Param: [regionCode, time]
            * @return: com.moral.constant.ResultMessage
            * @Author: 陈凯裕
            * @Date: 2022/3/16
            */
    @GetMapping("cityAreaRange")
    public ResultMessage cityAreaRange(Integer regionCode,@DateTimeFormat(pattern = "yyyy-MM-dd") Date time){
        if(regionCode==null || time==null){
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
                    ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        List<CityAreaRangeVO> vos = cityAqiDailyService.cityAreaRange(regionCode,time);
        return ResultMessage.ok(vos);
    }
    /**
      *@Description: 县市区数据
      *@Param: [regionCode]
      *@return: com.moral.constant.ResultMessage
      *@Author: lizijie
      *@Date: 2022/3/16 16:54
     **/
    @GetMapping("countyData")
    public ResultMessage countyData(Integer regionCode){
        if(regionCode==null){
            return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(),
                    ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg());
        }
        Map<String, Object> resultMap = cityAqiService.countyData(regionCode);
        return  ResultMessage.ok(resultMap);
    }
}