现在的能跑,但是肯定写的不好。
List<? extends WeatherData> data = weatherReportDao.getCoviReportData(reportType);
WeatherENUM weatherENUM = WeatherENUM.valueOf(reportFunction);
switch (weatherENUM){
case atmosphere:
data = atmosphereReportDao.getAtmosphereReportData(reportType);
break;
case covi:
data = weatherReportDao.getCoviReportData(reportType);
break;
case windSpeed:
data = windSpeedReportDao.getWindSpeedReportData(reportType);
break;
}
return data;
关键就是data的初始化,不初始化会报错。求指导。
2 回答
慕田峪4524236
TA贡献1875条经验 获得超5个赞
List<? extends WeatherData> data = null;
或者想办法把weatherENUM的某个值当作参数传到dao
List<? extends WeatherData> data = weatherReportDao.getReportData(reportType,dataType);
添加回答
举报
0/150
提交
取消