/// <summary> /// 站点小时实测数据 /// </summary> /// <returns></returns> private List <StationOrCityMeasuredData> requestAllStationMeasureHourDataFromServer() { string url = ServerAddress + "api-fims-model/measured/getStationHourlyData"; string json = AqiWebRequest.ReqUrl(url, paramData: "auditState=0&stationCode=" + getAllStationCode() + "&date=24"); return(readMeasuredDataFromJson(json)); }
/// <summary> /// 城市日实测数据 /// </summary> /// <returns></returns> private List <StationOrCityMeasuredData> requestCityMeasureDayDataFromServer() { string url = ServerAddress + "api-fims-model/measured/getCityDaylyData"; string json = AqiWebRequest.ReqUrl(url, paramData: "auditState=0&cityCode=410100&date=29"); return(readMeasuredDataFromJson(json)); }
/// <summary> /// 城市预报数据 /// </summary> /// <returns></returns> private List <CityForecastData> requestCityForecastDataFromServer() { string url = ServerAddress + "api-fims-model/correct/getCorrectData"; string json = AqiWebRequest.ReqUrl(url, paramData: "cityCodes=410100"); if (string.IsNullOrEmpty(json)) { return(new List <CityForecastData>()); } JsonSerializer serializer = new JsonSerializer(); StringReader sr = new StringReader(json); object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List <CityForecastData>)); var rs = o as List <CityForecastData>; if (null == rs) { rs = new List <CityForecastData>(); } return(rs); }
private List <Station> requestAllStationFromServer() { string json = AqiWebRequest.ReqUrl(ServerAddress + "api-fims-model/station/getStationData", paramData: "cityCode=" + CityCode); if (string.IsNullOrEmpty(json)) { return(null); } JsonSerializer serializer = new JsonSerializer(); StringReader sr = new StringReader(json); object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List <Station>)); var result = o as List <Station>; foreach (var s in result) { s.FirstPinyin = getFirstPinyin(s.StationName); } return(result); }