第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

大佬們,這個(gè)報(bào)錯(cuò)原因是啥呀

大佬們,這個(gè)報(bào)錯(cuò)原因是啥呀http://img1.sycdn.imooc.com//61e834010001fdf028001608.jpg

正在回答

2 回答

public?List<DayWeather>?w3d(String?appCode,?String?area)?{
????List<DayWeather>?resultList?=?new?ArrayList<DayWeather>();
????try?{
????????//新建查詢請求
????????OkHttpClient?client?=?new?OkHttpClient();
????????Request?request?=?new?Request.Builder()
????????????????.get()
????????????????.url("http://ali-weather.showapi.com/day15?area="?+?area)
????????????????.header("Authorization",?"APPCODE?"?+?appCode)
????????????????.build();
????????Call?call?=?client.newCall(request);
????????Response?response?=?call.execute();
????????Gson?gson?=?new?GsonBuilder()
????????????????.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
????????????????.create();
????????//獲取服務(wù)器返回?cái)?shù)據(jù)
????????String?resBody?=?response.body().string();
????????Map?result?=?gson.fromJson(resBody,?new?TypeToken<Map>()?{
????????}.getType());
????????//包裝為對象集合
????????//?*************?以下是修改部分?********************
????????List<Map<String,?String>>?dayList?=?this.getValue(result,?"showapi_res_body.dayList",?ArrayList.class);
????????//如果沒有找到對應(yīng)地區(qū)天氣數(shù)據(jù),返回空的List列表
????????if?(dayList?==?null?||?dayList.size()?==?0)?{
????????????return?new?ArrayList<DayWeather>();
????????}
????????Iterator<Map<String,?String>>?iterator?=?dayList.iterator();
????????for?(int?i?=?0;?i?<?3;?i++)?{
????????????if?(iterator.hasNext())?{
????????????????Map<String,?String>?day?=?iterator.next();
????????????????DayWeather?dayWeather?=?new?DayWeather();
????????????????dayWeather.setYear(day.get("daytime").substring(0,?4));
????????????????dayWeather.setMonth(day.get("daytime").substring(4,?6));
????????????????dayWeather.setDay(day.get("daytime").substring(6,?8));
????????????????dayWeather.setDayAirTemperature(day.get("day_air_temperature"));
????????????????dayWeather.setNightAirTemperature(day.get("night_air_temperature"));
????????????????dayWeather.setDayWeather(day.get("day_weather"));
????????????????dayWeather.setNightWeather(day.get("night_weather"));
????????????????dayWeather.setDayWindPower(day.get("day_wind_power"));
????????????????dayWeather.setNightWindPower(day.get("night_wind_power"));
????????????????resultList.add(dayWeather);
????????????}
????????}
????????//?*************?以上是修改部分?********************

????}?catch?(Exception?e)?{
????????throw?new?RuntimeException(e);
????}
????return?resultList;
}


0 回復(fù) 有任何疑惑可以回復(fù)我~

你下的那個(gè)阿里云里面的天氣預(yù)報(bào)的版本不一樣,要下跟老師一樣的那個(gè)版本,就是有免費(fèi)版三個(gè)字的版本

搜索

復(fù)制

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

大佬們,這個(gè)報(bào)錯(cuò)原因是啥呀

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號