PM2.5
This commit is contained in:
@ -0,0 +1,71 @@
|
||||
package com.ruoyi.web.controller.yada;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.system.domain_yada.OceanTemperatureVO;
|
||||
import com.ruoyi.system.domain_yada.vo.PmKeyValueEnVo;
|
||||
import com.ruoyi.system.domain_yada.vo.PmKeyValueVo;
|
||||
import com.ruoyi.system.domain_yada.vo.PmYearConcentrationRatioVo;
|
||||
import com.ruoyi.system.service_yada.PmDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Mr.C
|
||||
*/
|
||||
@Api(tags = "pm2.5数据变化")
|
||||
@RestController
|
||||
@RequestMapping(value = "/business-service/api/PM", produces = "application/json;charset=UTF-8")
|
||||
public class PmDataController {
|
||||
@Resource
|
||||
private PmDataService pmDataService;
|
||||
|
||||
|
||||
@RequestMapping(value = "/Average", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "PM2.5年平均浓度", httpMethod = "GET")
|
||||
public AjaxResult pmYearAverage(@RequestParam(value = "region") String region) {
|
||||
PmKeyValueVo byRegion = pmDataService.findByRegion(region);
|
||||
return AjaxResult.success(byRegion);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ChangeRate", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "年澜湄5国PM2.5年平均浓度变化率", httpMethod = "GET")
|
||||
public AjaxResult changeRate() {
|
||||
PmKeyValueEnVo pmKeyValueEnVo = pmDataService.changeRate();
|
||||
return AjaxResult.success(pmKeyValueEnVo);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/YearRate", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "PM2.5年平均浓度占比", httpMethod = "GET")
|
||||
public AjaxResult yearRatio(@RequestParam(value = "year") String year,
|
||||
@RequestParam(value = "region") String region) {
|
||||
List<PmYearConcentrationRatioVo> pmYearConcentrationRatioVos = pmDataService.yearRatio(year,region);
|
||||
return AjaxResult.success(pmYearConcentrationRatioVos);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/YearAverage", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "澜湄5国PM2.5年平均浓度", httpMethod = "GET")
|
||||
public AjaxResult average(@RequestParam(value = "year") String year) {
|
||||
PmKeyValueEnVo average = pmDataService.average(year);
|
||||
return AjaxResult.success(average);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/ChangeRateRatio", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "2016-2020年PM2.5年平均浓度变化率占比", httpMethod = "GET")
|
||||
public AjaxResult changeRateRatio(@RequestParam(value = "region") String region) {
|
||||
List<PmYearConcentrationRatioVo> pmYearConcentrationRatioVos = pmDataService.changeRateRatio(region);
|
||||
return AjaxResult.success(pmYearConcentrationRatioVos);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/MonthAverage", method = {RequestMethod.GET})
|
||||
@ApiOperation(value = "PM2.5月平均浓度", httpMethod = "GET")
|
||||
public AjaxResult monthAverage(@RequestParam(value = "year") String year,
|
||||
@RequestParam(value = "region") String region) {
|
||||
PmKeyValueVo pmKeyValueVo = pmDataService.monthAverage(year, region);
|
||||
return AjaxResult.success(pmKeyValueVo);
|
||||
}
|
||||
}
|
@ -6,8 +6,8 @@ spring:
|
||||
driver-class-name: org.postgresql.Driver
|
||||
druid:
|
||||
master:
|
||||
url: jdbc:postgresql://121.36.229.60:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
#url: jdbc:postgresql://192.168.2.9:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
#url: jdbc:postgresql://121.36.229.60:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:postgresql://192.168.2.9:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||
username: sjs
|
||||
password: song5325
|
||||
# url: jdbc:mysql://192.168.2.9:3306/nuoyi?AllowPublicKeyRetrieval=True&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
|
Reference in New Issue
Block a user